DB_DataObject - updating columns with relative values
| From: | Phil Gyford | Date: | Tue, 18 Jan 2005 16:23:15 +0000 |
| Subject: | DB_DataObject - updating columns with relative values | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16997@lists.php.net to get a copy of this message | ||
Hi,
Using DB_DataObject, is it possible to perform queries along the lines of:
UPDATE votes SET count = count+1 WHERE id > 5;
ie, updating column values depending on current column values for
several rows? I can use whereAdd() to set the WHERE constraint of
course, but I'm not sure how to set the 'count' column to be
incremented by 1 using DB_DataObject. Is this possible?
Thanks,
Phil