GregL83 Posted November 21, 2010 Share Posted November 21, 2010 Hey, I'm trying to run a update using the db adapter object in zend framwork. I want to have simple math in the sql statement using the update function. Is this possible? i.e. $data = array( 'number' => 'number + 1' ); $where = array( 'id = ?' => 1 ); $db->update('sampleTable', $data, $where); Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/219340-zend-framework-db-update-simple-math/ Share on other sites More sharing options...
GregL83 Posted November 21, 2010 Author Share Posted November 21, 2010 That didn't take me long... $data = array( 'number' => new Zend_Db_Expr('number + 1') ); http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapter.write.insert Quote Link to comment https://forums.phpfreaks.com/topic/219340-zend-framework-db-update-simple-math/#findComment-1137369 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.