开发者

How to write query in Zend framework?

开发者 https://www.devze.com 2023-03-26 03:20 出处:网络
My Query is UPDATE clms_data SET product_price= Product_price+ current _Price where id = 4开发者_开发知识库40;

My Query is

 UPDATE clms_data
 SET product_price= Product_price+ current _Price where id = 4开发者_开发知识库40;

how can write code to this using Zend_Db.


$db = Zend_Db::factory('Pdo_Mysql', $dbConnect);
$data = array('Product_price' => new Zend_Db_Expr('Product_price+current_Price'));
$db->update('clms_data', $data, 'id = 440');

where $dbConnect is your connection array

0

精彩评论

暂无评论...
验证码 换一张
取 消