tedd wrote:
Hi:

I know how to upload an image from a file into a BLOB in mySQL, but how do you place an image that's in memory into mySQL?

For example, if I create an image via resampling another image or create a new image, how do I get that image into mySQL? I know I can save it as a file and load it back in again, but that's clumsy. I thought that I had the answer, but I can't find my code any longer -- arrgggh.

In any event, thanks for any suggestions.

tedd

Something like this?

<?php
$im = imagecreatefrompng("test.png");

ob_start();

imagepng($im);

$binary_image = ob_get_contents();

ob_end_clean();

insert into table(imagefield) values($binary_image);

?>

--
Postgresql & php tutorials
http://www.designmagick.com/

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

Reply via email to