include("../config.inc.php");
//เชื่อมต่อ database
mysql_connect($host,$user,$passwd);
// หาจำนวนหน้าทั้งหมด
$list_rows=10;
if (empty($page)){
$page=1;
}
////////////////////////////////////////////////// เรียกข้อมูลจากตาราง citylifefm_activity ///////////////////////////////////////////////////
$sql="select * from citylifefm_activity where act_type = 'a' ";
$result = mysql_db_query($dbname,$sql);
$NRow = mysql_num_rows($result);
$rt = $NRow%$list_rows;
if($rt!=0) {
$totalpage = floor($NRow/$list_rows)+1;
}
else {
$totalpage = floor($NRow/$list_rows);
}
$goto = ($page-1)*$list_rows;
$sql="select * from citylifefm_activity where act_type = 'a' order by act_on desc limit $goto,$list_rows";
$result = mysql_db_query($dbname,$sql);
?>
หน้าแรกของกิจกรรม
mysql_close();?>