problem with autoExecute - update only
| From: | +gadhra+ | Date: | Wed, 22 Jan 2003 20:03:21 +0000 |
| Subject: | problem with autoExecute - update only | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3409@lists.php.net to get a copy of this message | ||
Hi all,
Hopefully this is something quick, but I'm a bit stumped. I checked through the archives and didn't come across anything helpful.
I can't seem to get the autoExecute function to work when I try to update a record in a MySQL database. I instantiated the object $db['mydb'] in another file, and have included it in my script (in case it's not clear from the code below, this object is being called in line 4). Here's a sample script I made - bare bones for what I'm trying to do:
1. <?php
2. $fields_values = array ('intLocation' => '10');
3. $table_name = 'sometbl';
4. $db['mydb']->autoExecute($table_name, $fields_values, DB_AUTOQUERY_UPDATE, 'id=4');
?>
The where parameter (last param) seems to be throwing things off. When it's included, I get the DB_ERROR_NEED_MORE_DATA error of "insufficient data supplied". When I drop the where parameter (id=4), it works fine (though it updates all my records). Throwing the INSERT parameter works fine, too, but I suspect it's because of the lack of the where param.
The table structure is two columns - id and intLocation - for the sake of this test.
Any thoughts would be appreciated!!
Thanks,
+gadhra+