我不知道为什么不显示头像100x100。有些事情是错的,我不知道如何解决它。
$result = mysqli_query($con,"SELECT * FROM `users` WHERE `verified` = 1 and lastcheck=0 order by `authoredPostCount` DESC");
echo "<table border='1'> <tr>
<th>Picture</th>
<th>Verified</th>
<th>Videos</th></tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row "<img src="['avatar']."></td>";
echo "<td>" . $row['userId'] . "</td>";
echo "<td>" . $row['authoredPostCount'] . "</td>";
echo "</tr>";
}
echo "</table>";
if (!$cuserId) {
printf("Error: %s\n", mysqli_error($con));
exit();
}
mysqli_close($con);
?>
答案 0 :(得分:0)
替换
echo "<td>" . $row "<img src="['avatar']."></td>";
使用
echo "<td><img src=". $row['avatar']."></td>";
答案 1 :(得分:0)
如果要在数据库中保存图像文件名,那么就像那样使用它
echo "<td><img src='path/to/folder/". $row['avatar'].".jpeg'></td>";