Any ideas why this doesn't write anything to the database?
// this line actually does the image resizing, copying from the original
// image into the $tmp image
imagecopyresampled($tmp, $src, 0, 0, 0, 0, $widthr, $heightr, $width_orig, $height_orig);
imagejpeg($tmp, "test.jpg", 100); //imagejpeg($resampled, $fileName, $quality);
$instr = fopen("test.jpg","rb"); //need to move this to a safe directory
$image = addslashes(fread($instr,filesize("test.jpg")));
mysql_query("UPDATE `upload` SET `thumbnail`= ( \"".$image.""\) WHERE `intProductID`= '$adid' ");
imagedestroy($src);
imagedestroy($tmp); // NOTE: PHP will clean up the temp file it created when the request
// has completed.