I’m trying to make a PHP photo gallery (yes, I’ve tried other solutions, none work with the setup I want) and I am trying to make this while loop stop after three times, because I want to show three thumbnails per table row. Here’s my current code:
<table>
<tr>
<?php while($row2 = mysql_fetch_assoc($result)) { echo "
<td><a href='URL/".$row2['file']."'><img src='URL/".$row2['file']."' width='200' height='106' /></a></td>
"; } ?>
</tr>
</table>
I don’t remember learning anything about stopping PHP loops, so please help! It’d be greatly appreciated.
So what you actually want is 3 images per row. I think this will work: