"The image “http://localhost/work/pregnancy/handle.php” cannot be displayed because it contains errors."
The image is stored as a BLOB. Here is my code to retrieve the image:
mysql_connect($dbhost, $dbuser, $dbpass) or die("Can not connect to database: ".mysql_error()); mysql_select_db($dbname) or die("Can not select the database: ".mysql_error()); $query = mysql_query("SELECT * FROM images_test WHERE pid=3"); $row = mysql_fetch_array($query); $content = $row['image']; header('Content-type: image/jpg'); echo $content; ?>
I know the script works in general, because I changed it a bit to retrieve the pic id, and that displayed fine, so it is just when pulling an image. Any hints, ideas or a good tutorial would be great. thanks.