<table width="251" height="42" border="1">
<?php
$count=0;
while($rs=mysql_fetch_array($result)) {
if($count % 3 == 0){
echo '<tr>';
}
echo '<td>'.$rs[img].'</td>';
if($count % 3 == 0){
echo '</tr>';
}
$count ++;
};
?>
</table>
<?php
$count=0;
while($rs=mysql_fetch_array($result)) {
if($count % 3 == 0){
echo '<tr>';
}
echo '<td>'.$rs[img].'</td>';
if($count % 3 == 0){
echo '</tr>';
}
$count ++;
};
?>
</table>
<table width="251" height="42" border="1">
<tr>
<?php
$i=0;
while($rs=mysql_fetch_array($result)) { ?> <td> <?php
if($i%3==0)
echo "</td></tr><tr><td>";
echo "$rs[img]";
$i++;
?> </td> <?php };?>
</tr>
</table>