you want to store the files in a db, but I would simply advise storing them in a directory on the server, and in the db simply holding the name of the file and the location of the file. You can store the file in the db as a blob - but its only going to increase the size of the db, and might slow it down.
you really need to read up a bit on it before going ahead as you need to understand the code - but heres how to do it:
$insertSQL = sprintf("INSERT INTO photodb (title, notes, type, location, year, month, day, thumb_loc) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['photo_name'], "text"),
GetSQLValueString($HTTP_POST_VARS['photo_description'], "text"),
GetSQLValueString($HTTP_POST_VARS['photo_type'], "text"),
GetSQLValueString("images/fullpictures/$photo_type/".$HTTP_POST_FILES['photo_location']['name'], "text"),
GetSQLValueString($HTTP_POST_VARS['Year'], "int"),
GetSQLValueString($HTTP_POST_VARS['Month'], "int"),
GetSQLValueString($HTTP_POST_VARS['Day'], "int"),
GetSQLValueString($thumb_loc, "text"));
oh, and to copy the file onto the server take a look at:
http://www.php.net/copy
Take a look at php.net and search for db on the site and it should answer most questions you have regarding this.
again, good luck.
w.