Re: DB_DataObject producing incorrect SQL (Cont.)

From: Date: Mon, 13 Nov 2006 07:13:04 +0000
Subject: Re: DB_DataObject producing incorrect SQL (Cont.)
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25799@lists.php.net to get a copy of this message
Hi Michael, Give this a try: $do->update(DB_DATAOBJECT_WHEREADD_ONLY); Dave Michael Henry wrote:
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!
-- David Sanders Software Engineer Baseline Solutions Pty Ltd Suite 201 832 High St East Kew VIC 3123 Australia Phone: (03) 9249 9687 Fax: (03) 9249 9600 ======================================================================== This e-mail contains privileged and confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in reliance on it. Please notify Baseline Solutions Pty Ltd via e-mail (security@baselinesols.com) if you are not the intended addressee of this e-mail transmission. Any views or opinions presented in this message are solely those of the author. ========================================================================

« previous php.pear.general (#25799) next »