I've been doing PHP for a pretty good while now, and I've been able to solve most of my own problems. Before I spend hours troubleshooting this one, I think I should ask the list:

I have a script that accepts large files (images) and inserts them into a MySQL table. The images are manipulated and whatnot, no problems at all getting the image into a string and running addslashes() on it. Then I go and use it with a mysql query. This is something I've coded dozens of times, but now there's a twist. The files are bigger than I've ever worked with. In theory, I didn't think there would be a problem, but there is. When I try in insert a file of about 800K or larger (9-10 MB is as large as I ever try to insert) the insert fails. The query is written correctly AKAIK, but no data reaches the table I'm writing to.

The only difference between queries that work and those that do not work is the size of the file I'm trying to insert.

I'm running the same basic code a few times, once to save the original image (only lightly used), once to save a preview image, and once more to save a thumbnail image. I use the same SQL query and code to run all the queries. All the tables use mediumblobs except for the originals which uses longblobs, so there should be no problem in terms of size. I've upped my memory limit for php scripts and the file upload size but I'm not having any success getting the query to go through, even though I'm confident I have the correct data to insert (I can echo it back to the browser or write it to a file, no problem.) The problem is happening between mysql_query($query) and the mysql app. FYI, I'm running PHP 4.3.x (not sure which version, ATM), MySQL 4.0.14 and Apache 1.x under Mac OS X. I could dig out the exact versions, this is just a testing box that is quite reliable so I'm not real concerned with those kinds of things.

And before you guys tell me I should save my files in the filesystem, I'm very aware of how that works but I'd rather not do it for various reasons. I'm trying to solve this problem of long queries failing. If I can't solve it, I'll look into other options to do what I need to do.

Thanks!

-Galen

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to