Re: LOAD_FILE and PHP
| From: | John W. Holmes | Date: | Fri, 16 Jan 2004 15:38:59 +0000 |
| Subject: | Re: LOAD_FILE and PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174833@lists.php.net to get a copy of this message | ||
Jough P wrote:
Greetings all, I can't get LOAD_FILE to work in an INSERT statement from PHP. The generated sql works when you're in mysql but won't work from PHP. BSDB is my database object. sql_query basically just does a mysql_query and some error outputting stuff. There error is: Column 'photo' cannot be null My SQL statement is: INSERT INTO photo VALUES('', LOAD_FILE("/Library/WebServer/Documents/var/tmp/default_smiley.png"))You're inserting two columns in your query, which one is "photo"? I assume the second, which means LOAD_FILE() is returning a NULL? (from your error message at least). The file must be world readable in order for MySQL to read it and insert it into the table. I assume you've doublechecked the path, also?? :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com