我已经在xampp上将两个图像插入到测试数据库中,我编写了几个用于显示图像的代码。但是我遇到了错误,我有屏幕截图:
我需要在div中显示一个img,点击后会显示该文件:
<?php
$server = "localhost";
$username = "daiori";
$password = "";
$db = "test";
$conn = mysqli_connect($server, $username, $password, $db);
$sql = "SELECT `pictures`, `filename` FROM `pictures`";
$run = mysqli_query($conn, $sql);
$pictures = array($rows=>id, $rows=>filename,$rows=>pictures);
header("Content-Type: image/jpeg");
header("Content-Type: image/png");
header("Content-Type: image/gif");
function showFile(){
$pictures;
}
$arrlength = count($pictures);
while($rows == true){
for($i = 0; $i < $arrlength; $i++){
base64_decode($pictures[$i], false);
}
showFile();
}
?>