Hallo Alexander,
vielen Dank, für Deine Hilfe. Der gesamte Code sieht so aus: Noch mal ganz kurz erwähnt. In der Tabelle "fotos" stehen genau die Tabellennamen: f_sommer2004 bis f_sommer2005.
<?PHP
mysql_connect("localhost", "xxxxxx", "xxxxxx") or die ("Keine Verbindung");
mysql_select_db("xxxxxx") or die ("Keine Datenbank");
$sql2 = "SELECT `tabelle` FROM `fotos` ORDER BY `nr` DESC";
$result2 = mysql_query($sql2);
$vsql1 = "SELECT `image` FROM `f_sommer2008` ORDER BY `nr` DESC";
$vresult1 = mysql_query($vsql1);
$vsql2 = "SELECT `image` FROM `f_sommer2007` ORDER BY `nr` DESC";
$vresult2 = mysql_query($vsql2);
$vsql3 = "SELECT `image` FROM `f_sommer2006` ORDER BY `nr` DESC";
$vresult3 = mysql_query($vsql3);
$vsql4 = "SELECT `image` FROM `f_sommer2005` ORDER BY `nr` DESC";
$vresult4 = mysql_query($vsql4);
$vsql5 = "SELECT `image` FROM `f_sommer2004` ORDER BY `nr` DESC";
$vresult5 = mysql_query($vsql5);
mysql_close();
?>
<script type="text/javascript">
/* <![CDATA[ */
<?PHP
$j=0;
while($row2 = mysql_fetch_object($result2)){
$tabelle=$row2->tabelle;
$j+=1;
echo "var viewer$j = new PhotoViewer();\n";
while($vrow1 = mysql_fetch_object($vresult1)){
echo "viewer$j.add('fotograflar/$tabelle/$vrow1->image;');\n";
}
}
?>
/* ]]> */
</script>
Viele Grüße
Astero