Re: Storing JPEGS in MySQL

From: Date: Thu, 03 Feb 2005 00:09:16 +0000
Subject: Re: Storing JPEGS in MySQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38460@lists.php.net to get a copy of this message
this was discussed just last week..find the thread or go here http://www.weberdev.com/get_example.php3?count=4063 bastien
From: Jason Wong <php-db@gremlins.biz> To: php-db@lists.php.net Subject: Re: [PHP-DB] Storing JPEGS in MySQL Date: Thu, 3 Feb 2005 07:55:39 +0800 On Thursday 03 February 2005 05:59, A Wood wrote: The image is resized like this, and as I say, this far its working fine... imagecopyresampled($image, $contents, 0, 0, 0, 0, $newxsize, $newysize, $orig_x, $orig_y); I then try to put it in the DB by passing the variable $image straight into an SQL query. is that correct? No, $image is the "image resource handle" ... The script executes fine with no errors, and there's something being put in the LONGBLOB field of the DB (Resource ID #3 it says when I look at it). ... and it this particular case your "image resource handle" has an ID of 3. What you need is output buffering and imagejpeg(). If you're still stuck check out the umpteen working examples and tutorials available somewhere. The type field is set correctly by the upload script and is "image/jpeg" Again this script runs without errors but doesnt produce anything. Yep, because you haven't stored anything resembling an image in the DB! -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db ------------------------------------------ New Year Resolution: Ignore top posted posts -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.db (#38460) next »