Forum Moderators: coopster

Message Too Old, No Replies

Split mysql fetch array in pages

split mysql_fetch_array in pages

         

dutchman

9:02 pm on Feb 4, 2010 (gmt 0)

10+ Year Member



Hello! I am new on this forum and like it already :) As I am just getting started with PHP I hope someone can help me out..

I have created the following script and want to split the output into pages, but I don“t know where to begin. I have tried it already with the help of google, but I am not able to get it work...

Please help :)

<table style="clear:both; width:500px; margin-top:10px;" cellpadding="0" cellspacing="0" border="0">

<tr>
<th>Picture</th>
<th>City</th>
<th>Details</th>

</tr>

<?php while ($row = mysql_fetch_array($result)){
echo ("<tr class=\"color1\" onmouseout=\"style.backgroundColor='#F3F5F6'\" onclick=\"document.location.href='#.html'\" onmouseover=\"this.style.cursor='pointer'; style.backgroundColor='#ffffff'\" ><td><a href=\"details.php?id=" .$row['id'] . "\"><img src=../../images/".$rij['image']." width=\"130\" height=\"98\" class=\"img_left\" alt=\"\" title=\"\" border=\"0\"/></a></td> " .
"<td>" . $row['city'] . " </td> " .
"<td><a href=\"details.php?id=" .$row['id'] . "\">Click</a></td></tr>" .
" ");
} ?>

</table>

Kings on steeds

12:28 pm on Feb 5, 2010 (gmt 0)

rocknbil

7:10 pm on Feb 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard dutchman, here is eelixduppy's thread [webmasterworld.com] on pagination, though you'll have to ignore the site callouts in the code (this is getting fixed, I'm told.)

More threads on this site, many ways to do this [google.com]