mysql_fetch_assoc only returns 1 result
mysql_fetch_assoc
is only fetching one record (checked database side of things all good)
<?p开发者_JS百科hp
$folder_id = $_GET['folder_id'];
$query = mysql_query("SELECT * FROM gallery_photos WHERE folder_id = $folder_id");
if (mysql_num_rows($query) == 0)
{
echo '<h2>Sorry, you cannot change a folders photo cover if that folder has
no photos in it<br /> <a href="gallery.albums.php?fder_id='
.$folder_id.'">Back to the folder</a><h2>';
}
else
{
while ($row = mysql_fetch_assoc($query))
{
echo '<img src="gallery_photos/'.$row['photo_name'].'" width="200"';
}
}
?>
You're not closing the HTML IMG tag. Add the />
to your tag.
echo '<img src="gallery_photos/'.$row['photo_name'].'" width="200" />';
精彩评论