【发布时间】:2018-11-07 12:08:06
【问题描述】:
我的 PHP 代码在下面 回显的图像仅显示其缩略图
<?php
if(isset($_SESSION['user_id'])){
$userid = $_SESSION['user_id'] ;
$query = "SELECT img FROM user where iduser='{$userid}' LIMIT 1 ";
$result_set = mysqli_query($connection,$query);
while($row = mysqli_fetch_assoc($result_set)){
echo $row['img'];
if(is_null($row['img'])){
echo '<img src="assets/images/fuser.png" class="img-responsive img-thumbnail" style="height:256px;width:256px">';
}else{
echo '<img src="assets/images/"'.$row['img'].'" class="img-responsive img-thumbnail" style="height:256px;width:256px">';
}
}
}
?>
我的图片是这样显示的 https://imgur.com/a/uXcdytz
【问题讨论】:
-
你正在使用 Bootstrap 的
img-thumbnail类! -
是的..但这不是原因..我删除了该类并再次尝试..但仍然遇到同样的问题。只需检查下面的链接imgur.com/a/uXcdytz
-
这意味着图片的来源(
src)有问题,看来问题出在你的回显字符串中,请参阅我的答案进行解释。
标签: php html css bootstrap-4