The following code works but it only prints 1 row of 5 images. How can I change it to print 2 or 3 rows of images?
<?
mysql_pconnect("xxx","xxx","xxx");
mysql_select_db("xxx");
if(!$rowstart) $rowstart=0;
$query = mysql_query("SELECT from birdhouses, birdhouse_images where (birdhouses.imageid = birdhouse_images.imageid)limit $rowstart,5");
$result2 = mysql_query("SELECT from birdhouses");
echo "<table align=center width=700 border=1><tr>";
while ($result=mysql_fetch_array($query)){
echo "<td align=center valign=top class=title>
<br>$result[bird_name]<br>
<a href='/displaybirdhouses.html?id=$result[bird_id]'><img border=0 height=156 width=116 alt='$result[bird_name]' src='/images/birdhouses/$result[frontimage]'></a>
<br>
$$result[bird_price]</td>";
}
echo "</tr></table>";
if ($rowstart>$numrows)
{?>
<a href="/displaybirdhouses.html?rowstart=<? echo $rowstart-5;?>">
< Previous </a>
<?}?>
|
<?
$numrows=mysql_num_rows($result2);
if($rowstart+5<$numrows)
{?>
<a href="<? $php_self?>rowstart=<?echo $rowstart+5 ;?>">
Next ></a>
<? } ?>