I'm trying to insert a file stored on the server, into a LONGBLOB, as type binary.
Here's my code snippet:
<pre> $filesize= filesize($form_file);
$data = fread(fopen($form_file, "r"), $filesize);
$result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ".
"VALUES ('$form_description','$data','$form_file','$filesize','application/x-zip-compressed')");
$id= mysql_insert_id();</pre>
$data does contain the contents of the selected zip file. But mySQL doesn't seem to want to accept it, always returning 0 (zero) for $id.
Can anybody PLEASE tell me where I'm going wrong?