Very Large MySQL Query String
| From: | David Bouw | Date: | Mon, 06 May 2002 12:22:10 +0000 |
| Subject: | Very Large MySQL Query String | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-96241@lists.php.net to get a copy of this message | ||
I can't seem to figure out the following.
I use the http upload functions a lot, works great!!..
For some months now I have been using a small PHP program
which I use to upload PDF files of scanned documents and
insert them into a Mysql table..
Normally these files are small (<250 kb), but I now have a
PDF of 1 MB... When uploading files I run the
function: chunk_split(base64_encode($binaryfile));
to encode it, this to transform the binary file to text.. (Works great!!!)
When the query was called to insert the data, nothing happens,
also no error from mysql... Only think I can think of is that the mysql
query string is to long.. ?? (The data when encoded is about 1.3 MB of
text)..
This is the source code..
if (!($userfile_size == 0))
{$fd = fopen ($userfile, "r");
$contents = fread ($fd, filesize ($userfile));
fclose ($fd);
unlink ($userfile);
echo "Eerste RAW: ".strlen($contents);
$encodes_data = chunk_split(base64_encode($contents));
$userfile_name = str_replace(" ", "", "$userfile_name");
echo strlen($encodes_data)." - Displays text size <BR>"; //Works right!
mysql ($databasename_boekhoud, "insert mubo_boekhoud_images (data,
originalname, groep, type)
values '$encodes_data', '$userfile_name', '$groep',
'$userfile_type')"); //
mysql_error(); //No error given..?
}
Any suggestions are very much appreciated...
With kind regards,
David Bouw