Forum Moderators: coopster
Instead of showing the photos the code below shows some alien language and a warning like this:
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\phpvt
SPi~ 1e^?+ J6e3CsY*Ѵ }GZxD=53mVqس1f'$Mh@ <Uf+ڹZ umG u- wл KZYVoX l d\ I },}-8uոfE`0 dcy p"1a =( }x+ \ LĿ0%
Here is the database structure:
dbname= test
table= tbl_images
id=int primary key not null auto increment
image= blob
description= text
taken_by=varchar(50)
email=varchar(50)
time=timestap
The php code is as follows:
<?php
$username = "*****";
$password = "*****";
$host = "localhost";
$database = "test";
@mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
@mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$query = mysql_query("SELECT * FROM tbl_images");
$row = mysql_fetch_array($query);
$content = $row['image'];
header('Content-type: image/jpg');
echo $content;
?>
What can I do or alter in this code to make the page display the image? I have been looking all over the internet with no success. Pls help