hi, first u need to create a table with the necessary fields, e.g. usin this code (I assume your db connection has been opened as $db):
mysql_query("CREATE TABLE files (id INT AUTO_INCREMENT, primary key(id), bin_data longblob NOT NULL, filename tinytext NOT NULL, size varchar(50) NOT NULL, type varchar(50) NOT NULL)", $db) || die("Could not create table");
run this code once, then, to add a file, try something like this:
$filename = "myfile.xyz";
$filedata = implode("", @file($filename));
$size = strlen($filedata);
$type = shell_exec("file $filename");
mysql_query("INSERT INTO files (id, bin_data, filename, size, type) VALUES(0, '$filedata', '$filename', '$size', '$type')") || die("Could not insert field");
note this block of code uses the unix file command to determine the mime type, and moreover, i wrote it from the top of my head so it might work or not... moreover, it does not perform any real error handling, just a few || die's but i think it's a good startin point.
hth