Im trying to limit the number of results per page... here is what I want to do: http://forums.devshed.com/t36525/s.html ... can someone please change my php so it will limit the results to 25 results/ page, and show previous and next pages...
my php is below... Thanks. 🙂
<?php
// Connect to the database
$db = mysql_connect("localhost","dhillis_site","password");
mysql_select_db (dhillis_site);
// Ask the database for the information from the games table
$sql = "SELECT id, title, price, description, shorttext, imageurl, company, platform, sale, console, shipping, yousave FROM games WHERE console='{$_REQUEST['console']}' ORDER by title asc";
if (!$result = mysql_query($sql)) {
print "Invalid query ($sql) : " . mysql_error();
exit;
}
while ($row = mysql_fetch_assoc($result)) {
print "<table width= '100%' cellspacing= '0' cellpadding ='1'><tr>
<td width= '45%'><font face= 'arial' size= '2'><B><a href= 'game.php?id={$row['id']}'>{$row['title']}</a></B> ${$row['price']}</font></td>
<td width= '30%'><font face= 'arial' size= '2'><B>{$row['company']}</td>
<td width= '15%'><font face= 'arial' size= '2'><B>{$row['console']}</td>
<td width= '10%'><font face= 'arial' size= '2'><B>{$row['price']}</td>
</tr></table>
";
}
?>
Please, please change that so I can have 25 results/ page, with next/ previous pages...