I'm trying to store images in a MySQL database (longblob) type.
I've got an example snippet code that a friend of mine did a while ago where he did this to store the image file:
and then there's obviously the sql where he inserted this data into the table.
He then has a getimg.php file that looks like this:
// Use this page to display images stored in the db
// usage: <img src=getimg.php?id=132> where id is the
// corresponding id number of the picture in the db
// Include common functions
// Connect to the database
// Extract source and filetype from db
$q=mysql_query(SELECT source,filetype FROM dbimg WHERE id=.$_REQUEST['id']);
// Send headers to browser to indicate type of image
// Send the image source to browser
Now my problem is this: The example code works fine and I copied it to use in my site, but it doesn't work for me (on the same server).