下面的代码结合我的数据库将一个图像呈现给浏览器,我想显示用户的所有图像,我应该如何修改下面的代码?
$coverpic = "";
$sql = "SELECT filename FROM photos WHERE user='$u'";
$query = mysqli_query($db_conx, $sql);
if(mysqli_num_rows($query) > 0){
$row = mysqli_fetch_row($query);
$filename = $row[0];
$coverpic = '<img src="user/'.$u.'/'.$filename.'" alt="pic">';
}