Here is how to insert file BLOB MySQL.
PHP CODE:
if($_POST[submit]){
$file_name = $_FILES['file']['name'];
$tmp_name = $_FILES['file']['tmp_name'];
$file_size = $_FILES['file']['size'];
$file_type = $_FILES['file']['type'];
$fp = fopen($tmp_name, 'r');
$file_content = fread($fp, $file_size) or die("Error: cannot read file");
$file_content = mysql_real_escape_string($file_content) or die("Error: cannot read file");
fclose($fp);
// INSERT
$qu = "INSERT INTO `file`
(`file_content`,`file_name`,`file_type`,`file_size`)
VALUES
('$content','$file_name','$file_type','$file_size')";
$re = mysql_query($qu) or die ("Sorry Cant insert db!");
echo $file_name." inserted succesfully to database";
}
echo "< form method=\"post\" name=\"form1\" enctype=\"multipart/form-data\">";
echo " < input name=\"file\" type=\"file\">";
echo " < input name=\"submit\" type=\"submit\" value=\"Upload\">";
echo "< /form>";