You\'d be much better off starting by saving your image files to disk. Saving them to a database opens up a whole big can of worms that you should probably avoid if you\'re new to PHP.
To work with dynamic images and all that cool stuff, you\'ll have to read up on the \"Header()\" php command, as well as information about \"Content-Type: img/*\" information.
This task is at the crossroads of some tricky topics, but here\'s some example code that I wrote once upon a time...
<?PHP
/---------
Send the User a File
*---/
$suggested_name=$info[ \'user_file_name\'];
if(empty($suggested_name)) {
$suggested_name = \"unknown.file\";
}
/*-**-**-**-**-**-**-**-**-**
* Send HTTP File Header
*-**-**-**/
Header( \"Content-type: application/x-executable\" );
Header( \"Content-Disposition: attachment; filename=\\\"$suggested_name\\\"\" );
/*-**-**-**-**-**-**-**-**-**
* Send Data Through HTTP
*-**-**-**/
$server_file_name=$info[ \'server_file_name\'];
readfile( $server_file_name );
?>
..instead of \"application/x-executable\", you\'ll want to use \"img/jpg\", or \"img/gif\", etc...
HTH...
--Robert