include("../admin/include/sql.php"); include('../admin/include/page_navigator.php'); $result_pro_hi = mysql_query("SELECT * FROM promotion_tb WHERE promotion_id = '1'"); $q = "SELECT * FROM promotion_tb WHERE category_id = '2' ORDER BY promotion_id DESC"; $qr=mysql_query($q); $total=mysql_num_rows($qr); $e_page=2; // กำหนด จำนวนรายการที่แสดงในแต่ละหน้า if(!isset($_GET['s_page'])){ $_GET['s_page']=0; }else{ $chk_page=$_GET['s_page']; $_GET['s_page']=$_GET['s_page']*$e_page; } $q.=" LIMIT ".$_GET['s_page'].",$e_page"; $qr=mysql_query($q); $num_rows = mysql_num_rows($qr); if(mysql_num_rows($qr)>=1){ $plus_p=($chk_page*$e_page)+mysql_num_rows($qr); }else{ $plus_p=($chk_page*$e_page); } $total_p=ceil($total/$e_page); $before_p=($chk_page*$e_page)+1; ?>
