2

I am using Zend framework 1.12. i want to know syntax of update query in Zend framework . My update query format is:

update `product` SET qty=qty+1 where uid=2354

what will qty=qty+1 syntex in zf1

Al Fahad
  • 2,378
  • 5
  • 28
  • 37
Raj Kumar
  • 58
  • 7

1 Answers1

2

You must use this code in class that extends Zend_Db_Table_Abstract

$whereQuery = array('uid = ?' => 2354);
$dataQuery = array('qty' => new Zend_Db_Expr('qty + 1'));
$this->update($dataQuery, $whereQuery);
Eduardo E.R.
  • 133
  • 4