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

2
  • 1
    possible duplicate of Increment a column in MySQL Commented Jan 21, 2015 at 21:44
  • thanks Alex Howansky for this link..... Commented Jan 21, 2015 at 21:54

1 Answer 1

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.