hi,
i can store images in a mysql database, but i am having trouble to retreive the image to show it in a webpage.
this is what i did :
___________________________________________________
@MYSQL_CONNECT("localhost","root","password");
@mysql_select_db("binary_data");
$query = "select image,i_filetype from product where product_code = '". $pid ."'";
$result = @MYSQL_QUERY($query);
$data = @MYSQL_RESULT($result,0,"image");
$type = @MYSQL_RESULT($result,0,"i_filetype");
echo "<BR><BR>";
echo "<img scr='$data'>";
_________________________________________________
what i get from this is all text and characters.(like when we open image file in a notepad)
can anyone please please help me out! ?(
i can store images in a mysql database, but i am having trouble to retreive the image to show it in a webpage.
this is what i did :
___________________________________________________
@MYSQL_CONNECT("localhost","root","password");
@mysql_select_db("binary_data");
$query = "select image,i_filetype from product where product_code = '". $pid ."'";
$result = @MYSQL_QUERY($query);
$data = @MYSQL_RESULT($result,0,"image");
$type = @MYSQL_RESULT($result,0,"i_filetype");
echo "<BR><BR>";
echo "<img scr='$data'>";
_________________________________________________
what i get from this is all text and characters.(like when we open image file in a notepad)
can anyone please please help me out! ?(