PHP's creating an image and I'm trying to store it into MySQL.  Instead of
raw binary data, all I'm getting is a resource reference.  To test this and
keep things as simple as possible, I took and created an image with
createimagefromjpeg.  Here's some example code of what I'm talking about:

$url = "http://mysite.com/picture.jpg";;
$im = imagecreatefromjpeg($url);

Imagejpeg($im);  // successfully displays image

I'm assuming that $im contains the binary data for the picture and I'd
expect to get raw binary output from:

echo $im;

But I don't... I get "reference #22" instead.

How would I go about accessing the raw data in order to store it into the
database successfully?  Do I need to know anything special about pulling it
back out and storing it in a variable?

Side note:  I know that storing images in a database isn't generally
optimal.  I've chosen this route because performance isn't an issue and ease
of tracking tens of thousands of images is important.

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to