2009年8月11日星期二

Re: [fw-db] update Zend_Db_Table_Abstract

allright, that's working... so I learned something new today. Thanks!


ert256 wrote:
>
> Have you tried this ?
>
> myModel = new MyTableModel();
> myModel->update('col1' => new Zend_Db_Expr('col1 + 2') , 'id = 1');
> --
> Rafał (ert16) Trójniak
> WEB : http://trojniak.net/
> m@il : ert256@gmail.com
> Jid : ert256@gmail.com
> GPG key-ID : 3F38968F
> 4711 E3BC B674 C841 BED8
> 0F8F 69D3 80CF 3F38 968F
>
>
> PHPScriptor <contact@phpscriptor.com>
> [Tue, 11 Aug 2009 13:38:36 -0700 (PDT)] :
>
>>
>> Hello,
>>
>> I want to add x to a column (int). In mysql something like this:
>>
>> update mytable set col1 = col1 + 2 where id = 1
>>
>> I tried this:
>>
>> myModel = new MyTableModel();
>> myModel->update('col1' => 'col1' + $x, 'id = 1');
>>
>> but this isn't working? Is there a simple way, where I don't have to get
>> the record first by e.g. fetchRow()?
>>
>> -----
>> visit my website at http://www.phpscriptor.com/
>> http://www.phpscriptor.com/
>
>
>


-----
visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/
--
View this message in context: http://www.nabble.com/update-Zend_Db_Table_Abstract-tp24925341p24925672.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: