I am trying to fetch my mysql records into a table, each cell must have one image only.
The problem is that the photo duplicated 5 times according to the number I need to fill each row.
Here is my code:
<table width="%" border="1" bordercolor="#F7F7F7" align="center" cellspacing="10" cellpadding="5">
<tr>
<?
for($i=0;$i<=5;$i++)
{
echo "<td width=125 height=125><img width=125 height=125 src=images/".$info['photo'] ."></td>";
} }?>
</tr>
</table>
How can I correct this code to make each photo fetched one time for each cell?
***** EDIT *****
I put the while inside the table, and the fetching is okay now, but it still fetch in the same row, I need to make something to stop fetching until I have 5 cells in the same row, then continue to fetch in a new row.
<table width="%" border="1" bordercolor="#F7F7F7" align="center" cellspacing="10" cellpadding="5">
<tr>
<?
while($info = mysql_fetch_array( $data ))
{
?>
<td width=125 height=125 ><img width=125 height=125 src=images/<? echo ($info['photo']); ?>></td>
<? } ?>
</tr>