I have 1 million+ records in database.
On the index page, multiple filter to filter through database create where clause. eg
select * from primaryinfo where category='abc' and technology='PQR'
I want to show--: 1. number of records found 2. pages. 3. 10 out 100(kind of thing) on the page.
Am sending the filtered records as json object to jquery, am looping through the records and appending to a particular div.
below is my php pagination code
$selectQ = "select * from primaryinfo where match(title,description,tags) against('".$searchCombine."') and category='abc' and technology='pqr'";
$result = mysql_query($selectQ);
$total_results = mysql_num_rows($result);
$total_pages = ceil($total_results / $per_page);
$start;
$end;
if (isset($_POST['pagecc']))
{
$show_page = $_POST['pagecc'];
if ($show_page > 0 && $show_page <= $total_pages)
{
$start = ($show_page - 1) * $per_page;
$end = $start + $per_page;
} else
{
$start = 0;
$end = $per_page;
}
}
else
{
$start = 0;
$end = $per_page;
}
if($end > $total_results)
$end = $total_results;
for($i=$start;$i<$end;$i++){
// here the json object is created
}