Help With Paging Mysql Results
Posted: Sat Sep 02, 2006 2:23 pm
Hi,
Could someone please help me with my problem? Im trying to page the results from my database to 10 per page and links to further pages at the bottom of the results, similar to what google or any search engine does. ive looked at loads of pieces of code but im still no closer to getting right.
This is the section of my results page i need help with.
Hope someone can help.
Cheers guys
Jon
Could someone please help me with my problem? Im trying to page the results from my database to 10 per page and links to further pages at the bottom of the results, similar to what google or any search engine does. ive looked at loads of pieces of code but im still no closer to getting right.
This is the section of my results page i need help with.
Code: Select all
<table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CACACA" background="images/topnav_bg_green.gif">
<tr>
<td width="90"><div align="left">Our Team</div></td>
<td width="148"><div align="left">Opposition </div></td>
<td width="76"><div align="left">Date</div></td>
<td width="55"><div align="left">H/W </div></td>
<td width="68"><div align="left">Competition </div></td>
<td width="106"><div align="left">Venue </div></td>
</tr>
</table>
<br />
<br />
<table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CACACA">
<?php
$sql = "SELECT * FROM fixres WHERE frstatus='fixture' ORDER By datecc";
if ($result = mysql_query($sql)) {
?><?php
while($row = mysql_fetch_array($result)) {
?>
<tr>
<td width="90"><div align="left"><?php echo $row['team']; ?>'s</div></td>
<td width="148"><div align="left"><?php echo $row['opposition']; ?> </div></td>
<td width="76"><div align="left"><?php echo $row['datecc']; ?></div></td>
<td width="55"><div align="left"><?php echo $row['home_away']; ?></div></td>
<td width="68"><div align="left"><?php echo $row['competition']; ?> </div></td>
<td width="106"><div align="left"><?php echo $row['venue']; ?> </div></td>
</tr>
</table>
<br /><table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr><? }} ?>
<td align="center" height="20"></td>
</tr>
</table>Cheers guys
Jon