Hey guys am having trouble displaying an image from the DB on a web page.
Am using this to display
echo "<img
src=image.php?"' width=300 height=270/>";
here is my image.PHP
<?php
session_start();
$con1=mysql_connect("localhost","root","roots");
mysql_select_db("blog",$con1);
if(!$con1)
{
die('could not connect'.mysql_error());
}
$q="select image from data where Number=1";
$result= mysql_query($q,$con1);
if($result)
{
$row=mysql_fetch_array($result);
header("content-type:image/jpeg");
echo $row['image'];
}
else
{
echo mysql_error();
}
?>