So könnte es gehen!
PHP-Code:
$result = mysql_query("SELECT id, datei, tn FROM fotos WHERE gallerie = '".$_GET['gallery']."' ");
$i = 0;
while($row = mysql_fetch_array($result)) {
echo "<a href="fotos.php?action=view&pic=";
echo $row["id"];
echo ""><img src="/pennywise1981/fotos/";
echo $_GET["gallery"];
echo "/";
echo $row["tn"];
echo ""></a>";
if($i == 5) {
echo "<br>";
$i = 0;
}
$i++;
}