"Rubal Jain" <ru*******@yahoo.com> wrote in message
news:7a*************************@posting.google.co m...
Hello,
How do I upload images under MySQL DB using PHP Script. Any Sample
script to upload and retrive images to MySQL DB would be appreciated.
Thanks
Rubal Jain
www.Rubal.Net
Use something like this if you want to store the image as a BLOB:
Store--
UPDATE tablename SET blobfieldname = LOAD_FILE('path:/to/image/image.jpg')
WHERE fieldid = $id LIMIT 1
Retrieve--
$myimg = mysql_fetch_array(mysql_query("SELECT blobfieldname FROM tablename
WHERE fielid = $id LIMIT 1"));
// $myimg[0] now holds your image. send approriate header and simply echo it
to display in browser
Norm
--
Avatar hosting at
www.easyavatar.com