Hoe kan ik er voor zorgen dat de 'fotoalbums' in onderstaand script op volgorde van album_id worden opgehaald, en niet op volgorde van toevoeging aan db (wat nu gebeurt)? Als er dus later foto's aan de db worden toegevoegd van een eerdere gebeurtenis, dan moeten de 'albums' op volgorde van activiteit staan... Voor de duidelijkheid, ik zorg er dus wel voor dat de laatst gebeurde activiteiten het 'hoogste' album_id hebben, maar dan nog zet 'ie ze op volgorde van toevoeging aan de db.... aaargh!!
Graag uitleg, want eigenlijk snap ik er maar weinig van... dank!!
<?php
if($album) {
echo "<p><b>". $titel ."</b></p> ";
if($foto_id) {
$an_id=mysql_query("SELECT * FROM fotos WHERE foto_id=". $foto_id);
while ($regel=mysql_fetch_array($an_id)){
$foto = $regel["foto"];
$tekst = $regel["tekst"];
echo "[img]\"images/upload/fotoalbum/".[/img]<br>\n";
echo "<center><font class=\"PLAIN\">".nl2br($tekst)."</font></center><br>\n";
}
echo "<a href=\"#\" onClick=\"history.back();\">[img]\"images/vorige.jpg\"[/img] vorige</a>\n";
} else {
$an_id=mysql_query("SELECT * FROM fotos WHERE album_id=". $album);
while ($regel=mysql_fetch_array($an_id)){
$thumbnail = $regel["thumbnail"];
$tekst = $regel["tekst"];
$id = $regel["foto_id"];
echo "<a href=\"". $PHP_SELF ."?pagina=fotoalbum&album=". $album ."&foto_id=". $id ."&titel=". $titel ."\">[img]\"images/upload/fotoalbum_thumbs/".[/img]</a> ";
}
echo "<br><a href=\"#\" onClick=\"history.back();\">[img]\"images/vorige.jpg\"[/img] vorige</a>\n";
}
} else {
echo "<p><b>Kies een album</b><br>Bekijk de naam van het album door met de muis er stil op te staan.</p>";
$an_id=mysql_query("SELECT * FROM albums");
while ($regel=mysql_fetch_array($an_id)){
$plaatje = $regel["plaatje"];
$tekst = $regel["tekst"];
$id = $regel["album_id"];
echo "<a href=\"". $PHP_SELF ."?pagina=fotoalbum&album=". $id ."&titel=". $tekst ."\">[img]\"images/upload/fotoalbum_thumbs/".[/img]</a> ";
}
}
?>
Graag uitleg, want eigenlijk snap ik er maar weinig van... dank!!
<?php
if($album) {
echo "<p><b>". $titel ."</b></p> ";
if($foto_id) {
$an_id=mysql_query("SELECT * FROM fotos WHERE foto_id=". $foto_id);
while ($regel=mysql_fetch_array($an_id)){
$foto = $regel["foto"];
$tekst = $regel["tekst"];
echo "[img]\"images/upload/fotoalbum/".[/img]<br>\n";
echo "<center><font class=\"PLAIN\">".nl2br($tekst)."</font></center><br>\n";
}
echo "<a href=\"#\" onClick=\"history.back();\">[img]\"images/vorige.jpg\"[/img] vorige</a>\n";
} else {
$an_id=mysql_query("SELECT * FROM fotos WHERE album_id=". $album);
while ($regel=mysql_fetch_array($an_id)){
$thumbnail = $regel["thumbnail"];
$tekst = $regel["tekst"];
$id = $regel["foto_id"];
echo "<a href=\"". $PHP_SELF ."?pagina=fotoalbum&album=". $album ."&foto_id=". $id ."&titel=". $titel ."\">[img]\"images/upload/fotoalbum_thumbs/".[/img]</a> ";
}
echo "<br><a href=\"#\" onClick=\"history.back();\">[img]\"images/vorige.jpg\"[/img] vorige</a>\n";
}
} else {
echo "<p><b>Kies een album</b><br>Bekijk de naam van het album door met de muis er stil op te staan.</p>";
$an_id=mysql_query("SELECT * FROM albums");
while ($regel=mysql_fetch_array($an_id)){
$plaatje = $regel["plaatje"];
$tekst = $regel["tekst"];
$id = $regel["album_id"];
echo "<a href=\"". $PHP_SELF ."?pagina=fotoalbum&album=". $id ."&titel=". $tekst ."\">[img]\"images/upload/fotoalbum_thumbs/".[/img]</a> ";
}
}
?>