开发者

mysql_fetch_assoc only returns 1 result

开发者 https://www.devze.com 2023-03-24 12:58 出处:网络
mysql_fetch_assoc is only fetching one record (checked database side of things all good) Php Code: <?p开发者_JS百科hp

mysql_fetch_assoc is only fetching one record (checked database side of things all good)

Php Code:

<?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" />';
0

精彩评论

暂无评论...
验证码 换一张
取 消