Problems inserting large blob
| From: | Joao Barreto | Date: | Thu, 13 Sep 2001 19:05:29 +0000 |
| Subject: | Problems inserting large blob | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12420@lists.php.net to get a copy of this message | ||
Hello all ...
I'm having a problem uploading large files (3MBytes for examples)
and inserting it onto a MySQL database. No problem with smaller files.
The code is basically this:
<?php
$data = addslashes(fread(fopen($form_data, "rb"), filesize($form_data)));
$result=MYSQL_QUERY("INSERT INTO file2download
(description,bin_data,filename,filesize,filetype, filecompany) ".
"VALUES
('$form_description','$data','$form_data_name','$form_data_size','$form_data
_type', '$empresa')");
if (mysql_errno() != 0) echo mysql_error();
$id= mysql_insert_id();
?>
When the files are the mentioned size (I checked the whole file got there on
/tmp/something)
I get an error message along these lines: 'MySQL Server moved away' and the
fid is 0.
Any ideas?
Is there any limitation on the size of the 'insert into' string? If so, how
can I store
such a big data chunk on the database?
And please, answer directly by email as well to me. Sometimes it is
difficult to find
a message among the ones that we get each day!
Thanks for your support,
João Barreto - Convex Portugal