Hey,
I am making a photo gallery program, I want this thing to have a table with 4 images across, then go down and make a new row, and have 4 more images, etc. I have written some code that made sense to me, but my program doesn't go down, it just keeps adding on to the row thats there. Any ideas?
for($i = 0; $i < $num; $i++) {
$picinfo = mysql_fetch_assoc($doget);
$name = $picinfo["name"];
$url = $picinfo["url"];
if($counter == 3) {
echo "</tr>";
echo "<tr>";
echo "<td width=\"25%\">";
echo "<br><center><a href=\"$url\"><img src=\"$url\" height=\"$thumbnailpic_height\" width=\"$thumbnailpic_width\"></a></center><br>";
echo "<center>$name</center>";
echo "</td>";
$counter = 0;
} else {
echo "<td width=\"25%\">";
echo "<br><center><a href=\"$url\"><img src=\"$url\" height=\"$thumbnailpic_height\" width=\"$thumbnailpic_width\"></a></center><br>";
echo "<center>$name</center>";
echo "</td>";
$counter = $counter++;
}
}