I'm in the process of converting all my images stored in a DB to a file system structure but can't seem to save them to a file. Here is what I'm trying.
....
$SQL = "SELECT thumbnail FROM profile_image WHERE user_id=7";
$r = mysql_query($SQL) or die ("Error");
$image=mysql_result($r,0,"thumbnail");
$destination = SITE_ROOT .'/photos/7/test.jpeg';
imagejpeg($image, $destination);
//header("Content-type: image/jpeg");
//echo ($image);
It's complaining about an invalid resource...what am I missing?