1
試圖在數據庫與此廣東話顯示圖像的PHP
$file = $_FILES['image']['tmp_name'];
$image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name = addslashes($_FILES['image']['name']);
$image_size = getimagesize($_FILES['image']['tmp_name']);
if($image_size == false)
{
echo "Not an image";
}
else
{
mysqli_query($link, "INSERT into Events (imagetype, Attachments)
VALUES ('$image_name', '$image')");
}
connection.php到uploadimage包括我的連接
嘗試與該檢索圖片:
include "connection.php";
$query = "SELECT imagetype,Attachments from Events where E_id='$id' ";
$result = mysqli_query($link,$query);
while ($row = mysqli_fetch_assoc($result))
{
header("Content-type:image/jpeg");
echo mysqli_result($row['Attachments'], 0);
}
你進入「圖像」 - ''image''字符串,而不是預期的變量。 –
你能告訴我具體在哪裏 –
我已經有了。除非這是一個壞的粘貼 –