this was discussed just last week..find the thread or go here


From: Jason Wong <[EMAIL PROTECTED]>
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 ->
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
Search the list archives before you post
New Year Resolution: Ignore top posted posts

PHP Database Mailing List (
To unsubscribe, visit:

-- PHP Database Mailing List ( To unsubscribe, visit:

Reply via email to