Instead of storing your image inside of the database create a upload folder then just store the image name into the database and when you want to call it just add the name at the end.
<?php
$image_qry=mysqli_query($mysqli,"SELECT * FROM Benutzer");
$image=mysqli_fetch_assoc($image_qry);
$link = directory of image;
$get_image=$link.$image; //This should contain the picture
echo file_get_contents($get_image);
?>
upload script:
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
}
reference:
http://www.w3schools.com/php/php_file_upload.asp
header()anywhere else has no extra function... Check if the image is actually in the database ... should be a BLOB field that can hold the image... A regular BLOB field is 65k, so if the image were larger than that, you don't have an imageecho mysqli_error($mysqli);to check if the query gave errors...