I want to display records from database using mysql_fetch_array. But the problem is i don't know how to fix the size to display in the page and move the rest of records to next page as there is too many records to be displayed.
Eg: Display first 10 rows(or records) in page1, then another 10 rows in another page?
Heres are my code:
$result=mysql_query("$selectKL UNION $selectKlang UNION $selectPJ UNION $selectSJ
ORDER BY restaurant_name LIMIT 6")
$searchQuery = search($budgetRange,$city,$category);
while($row = mysql_fetch_array($searchQuery))
{
echo"<tr>";
echo'<td>'.$row['restaurant_id'].'</b></td>';
echo'<td>'.$row['restaurant_name'].'</b></td>';
echo'<td>'.$row['category'].'</b></td>';
echo'<td>'.$row['budget'].'</b></td>';
echo'<td>'.$row['halal'].'</b></td>';
echo "</tr>";
}
There will be 30+ results to be displayed from my database but how do i display the first 10 result in 1st page, then another 10 result in next page and so on? I've already set the LIMIT to 10 in the query and yes it does only display 10 result, but i don't know how to store or pass the rest of result(is it possible?). Any help is appreciate... please?