Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
PHP
$image=addslashes(file_get_contents($file['tmp_name']));
$image_name=addslashes($file['name']);

$qry="INSERT INTO `cart`.`photo` (`id`, `iname`, `description`, `price`, `shipping`, `quantity`, `name`, `image`) VALUES ('', '$iname', '$desc', '$price', '$shipping', '$qunt', '$image_name','$image')";

I have using this code for inserting, in my datatype of my image column is BLOB.

when I am retrieving the image from database I got some unrecognized code.

display image:
PHP
echo '<img src="'.$get_row['image'].'" height="150ox" width="150px" alt="image" />';
Posted
Updated 21-Sep-13 4:17am
v3
Comments
NagaRaju Pesarlanka 21-Sep-13 9:13am    
I think error on echo tag for printing image on echo statement.
any one know the formate help me....
manikjeyam 21-Sep-13 9:55am    
http://www.ashishblog.com/blog/how-to-store-and-retrieve-image-in-database-using-c-asp-net-jquery/ refer this link

your store your image in BLOP format >So you can convert Blop to string after set the Imaga url
 
Share this answer
 
Comments
NagaRaju Pesarlanka 21-Sep-13 9:31am    
how to convert blob to string, I cant find in anyware, If you know tell me
thank you
manikjeyam 21-Sep-13 10:00am    
http://www.ashishblog.com/blog/how-to-store-and-retrieve-image-in-database-using-c-asp-net-jquery/ refer this link
manikjeyam 21-Sep-13 10:39am    
Check this link
http://www.ashishblog.com/blog/how-to-store-and-retrieve-image-in-database-using-c-asp-net-jquery/ refer this link
 
Share this answer
 
Comments
NagaRaju Pesarlanka 8-Nov-13 0:56am    
you have to give the answer in php with mysql only.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900