DB_DataObject producing incorrect SQL (Cont.)
| From: | Michael Henry | Date: | Mon, 13 Nov 2006 03:02:10 +0000 |
| Subject: | DB_DataObject producing incorrect SQL (Cont.) | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25798@lists.php.net to get a copy of this message | ||
Hi again,
As a short-term hack I thought I'd copy the code in sample 33-3 but I'm encountering the same problem:
$do = DB_DataObject::factory ('mlci.translations');
if (PEAR::isError($do)) {
throw new Exception('Unable to retrieve translations');
}
$do->translation = $value;
$do->whereAdd();
$do->whereAdd("lang = '{$lang}'");
$do->whereAdd("string_id = {$stringID}");
$do->update();
if (PEAR::isError($do)) {
throw new Exception("Failed to update translation");
}
This very simple code produces the following SQL:
UPDATE mlci.translations
SET translation = 'asdfasdf'
WHERE ( lang = 'to' )
AND ( string_id = 209 )
AND ( mlci.translations.translation = 'asdfasdf' )
Gah!