简体   繁体   English

mysql_fetch_assoc仅返回1个结果

[英]mysql_fetch_assoc only returns 1 result

mysql_fetch_assoc is only fetching one record (checked database side of things all good) mysql_fetch_assoc仅获取一条记录(检查数据库方面一切都很好)
Php Code: 邮递区号:

<?php 
$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. 您没有关闭HTML IMG标签。 Add the /> to your tag. />添加到标签中。

echo '<img src="gallery_photos/'.$row['photo_name'].'" width="200" />';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM