Re: image in memory to mySQL
| From: | Chris | Date: | Thu, 02 Mar 2006 00:41:10 +0000 |
| Subject: | Re: image in memory to mySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231300@lists.php.net to get a copy of this message | ||
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. teddSomething 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/