query($sql); $db->next_record(); $photo_id = $db->f('photo_id'); $photo_filetype = $db->f('photo_filetype'); $photo_file = $db->f('photo_file'); header("Content-Type: $photo_filetype"); echo $photo_file; ?>