try this:

$where = array('id = ?' => $id);
 $data = array(
 'date_connection' => date('Y-m-d H:i:s'),
 'nb_login' => new Zend_Db_Expr('nb_login+1')



 );



> -----Ursprüngliche Nachricht-----
> Von: debussy007 
> Gesendet: Do. 28.10.10 (12:22)
> An: [email protected]
> Betreff: [fw-general] Zend_Db data array and quoting question
> 
> 
> Hi,
> 
> I want to increment a field "nb_login" whenever a member connects.
> 
> These are the parameters that I give to update() method.
> 
> $where = array('id = ?' => $id);
> $data = array(
> 'date_connection' => date('Y-m-d H:i:s'),
> 'nb_login' => 'nb_login+1'
> );
> 
> The query is generated is :
>  `date_connection` = '2010-10-28
> 12:21:31',
> `nb_login` = 'nb_login+1' WHERE (id = 1)
> 
> This won't work because 'nb_login+1' is quoted. It would work if the
> statement would be :
> `nb_login` = nb_login+1
> 
> Thank you for any help
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Zend-Db-data-array-and-quoting-question-tp3016954p3016954.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> 
> -----Ursprüngliche Nachricht Ende-----



Reply via email to