working with images in my database

wxdqz

New Member
I have a sql server database in which one field is of image-type and i want to know how to save an image into it. one thing i can think of is to write an update query in php and say (pseudocode):

$image_data = require("imagefile.jpg");
$query = "UPDATE TABLENAME
SET IMAGEFIELD = " . $image_data .
"WHERE [some condition]";

This didn't work for me..but is it possible to make it work? Is there a better way any of you know of? I also don't know how to put the image on my webpage after I pull it out of the database..but one step at a time. :-)

Lastly, if anyone can answer my question about how to call sql server stored procedures in my php code by providing a one line example, that would be even more wonderful.

Thanks,

Sonny
 
Back
Top