希望有人能指出我正确的方向。我有一个函数要调用 并显示我数据库中的图像,这些图像不会为我加载。
以下是我的代码:
<?php
$itemQuery = "SELECT title, description, price, location FROM item;";
$returnItemQuery = (mysqli_query($conn, $itemQuery));
if (mysqli_num_rows($returnItemQuery) > 0) {
function getimage() {
include("connection.php");
$imageQuery = "SELECT image FROM item";
$image_info = (mysqli_query($imageQuery));
while ($image_data = mysqli_fetch_array($image_info)) {
echo $image_data['image'];
}
}
while ($row = mysqli_fetch_assoc($returnItemQuery)) {
$title = $row['title'];
$description = $row['description'];
$price = $row['price'];
$location = $row['location'];
echo "
<img src='$image'width='auto' height='auto'>
<br> Title: $title</br>
<br> Description : $description</br>
<br> Price: $price</br>
<br> Location: $location</br>";
}
}
?>
我有一个名为“ item”的表,图像保存为mediumBlob。在此先感谢您提供的任何帮助或指导!