Hi.
I'm trying to write a script that fetchs image codes from a mysql database to display them into a 3 columns table.
I got this so far:
$selection = $_GET['scelta'];
$query = 'SELECT photo_code FROM'. $selection .';';
$result = mysql_query($query);
$rows_nb = mysql_num_rows($query);
print('<table width="75%" border="0" align="center">');
while ($row = mysql_fetch_assoc($result))
{
print('<tr>');
for ($tb_rows=0;$tb_rows<3;$tb_rows++)
{
print('<td><div align="center"><a href="show.php?code='. $row['id'] .'"><img src="imagedb/thumbs/'. $row['id'] .'_small.png" border="1" /></a></div></td>');
}
print('</tr>');
}
print('</table>');
The for will print 3 columns and then create one more row for the next 3 pictures but now all it does is printing three times the same pic for each row.
How do I change the $row inside the for cicle?