Thank you for the post. did I put it right? seems like no effect.
Code:
<?php
include'../connection/connect-db.php';
$avail = $_POST['avail'];
$sec = $_POST['section'];
$strPage = $_REQUEST['Page'];
if($_REQUEST['mode']=="Listing"){
$query = "SELECT * ,b.b_Title as title, bac.id as bacid FROM tbl_book AS b
LEFT JOIN tbl_bdetail AS bd ON b.id = bd.b_Title
LEFT JOIN tbl_bacquisition AS bac ON bac.bd_Id = bd.id ";
$result = mysql_query($query) or die(mysql_error());
$Num_Rows = mysql_num_rows ($result);
########### pagins
$Per_Page = 15; // Records Per Page
$Page = $strPage;
if(!$strPage)
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
if (count($avail)>0)
{
$query.="WHERE bac.ba_Status = '$avail' ORDER BY ba_Accnum ASC LIMIT $Page_Start , $Per_Page";
}
if (count($sec)>0)
{
$query.="WHERE b.section_Id = '$sec' ORDER BY ba_Accnum ASC LIMIT $Page_Start , $Per_Page";
}
else { $query.="ORDER BY ba_Accnum ASC LIMIT $Page_Start , $Per_Page ";}
$result = mysql_query($query) or die(mysql_error());
Bookmarks