Hi Guys,
I need to loop results in rows of three. I can loop them all in a line going down. (code below) but I haven't a clue how to get them to run three across then start a new line and loop three again. Help!!
Thanks in advance
<?....database connection");
$query="SELECT * FROM wynnster";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$manufacturer=mysql_result($result,$i,"manufacturer");
$tn_pic=mysql_result($result,$i,"tn_pic");
$model=mysql_result($result,$i,"model");
$pic=mysql_result($result,$i,"pic");
++$i;
}
?>
<?
$i=0;
while ($i < $num) {
$tn_pic=mysql_result($result,$i,"tn_pic");
$model=mysql_result($result,$i,"model");
$pic=mysql_result($result,$i,"pic");
echo "
<table width=200 border=0 cellspacing=0 cellpadding=0>
<tr>
<td class=smalltext>$model</td>
</tr>
<td><a href=../../wynpic.php?pic=$pic&alt=$model border=6><img src=images/wynnster/tn/$tn_pic alt=$model><a/></td>
</tr>
</table>
";
++$i;
}
?>