How would I write this sql the Zend Framwork way?
UPDATE register
SET balance = (balance + 10)
WHERE added_date > 1259944184 ;
I can't find any examples of this on Zends website or the web.
Do I need to use "Zend_Db_Expr
" ?
thanks
How would I write this sql the Zend Framwork way?
UPDATE register
SET balance = (balance + 10)
WHERE added_date > 1259944184 ;
I can't find any examples of this on Zends website or the web.
Do I need to use "Zend_Db_Expr
" ?
thanks
acording to zend framwork documentation
use this
$data = array(
'balance' => 'balance + 10'
);
$n = $db->update('register ', $data, 'added_date > 1259944184');
This worked for me:
$data = array(balance => new Zend_DB_Expr('balance + 10'));
$db->update('register ', $data, 'added_date > 1259944184');