Hi,
How do u limit the number of results shown on a page, then have links at the bottom, for 'next' & 'previous'? anyone got any example code? or know where to get some?
This is my current code, it displays the results in a table, but if there are too many results you end up with a huge table, i just want to limit it to about 20 per page.
mysql_select_db("db");
$sql="SELECT * FROM table WHERE country='$country'";
$result=db_query($sql);
if (!$result || db_numrows($result) < 1) {
echo 'Sorry No Results';
} else {
while($rs=mysql_fetch_array($result)){
echo "<tr>
<td>$rs[0]</td>
<td>$rs[1]</td>
<td>$rs[2]</td>
<td>$rs[3]</td>
<td>$rs[4]</td>
</tr>\n";
}
}
Many Thanks
Ben