Here is the code I am using in a page. My field in the database for the image is 'mediumtext'.
This is an addon that is working with my existing VBulletin setup.
$filesize=@filesize($_FILES['rfile']['tmp_name']);
$filenum=@fopen($_FILES['rfile']['tmp_name'],"rb");
$filestuff=@fread($filenum,$filesize);
@fclose($filenum);
@unlink($_FILES['rfile']['tmp_name']);
$pcs = $DB_site->query("
INSERT LOW_PRIORITY
INTO pcs_reviews (category, author, title, review, score, picture, date)
VALUES($rcategory, '$author', '$rtitle', '$review', '$score', '".addslashes($filestuff)."', $rdate)
");
I think the data is inserting right, as stuff gets in the db. But when I go to pull the image out of the database, it always comes up a redx. When I try and pull other image data out of the database with the same script it works fine. So that was leading me to believe that my insert was not working properly.