开发者

Zend Framework Mysql Update

I need to execute this simple mysql query in Zend;

"UPDATE `table` SET `field`='field'+1 WHERE `field`>'" . $var . "'"

How can I do this with Zend u开发者_如何学编程pdate;

$this->update($data, $where);

But we hasn't data, we have only where.


How can you update a table if you don't know what are you going to update.

By the way, this is what I found in the Zend Framework Documentation

$table = new Bugs();
$data = array(
'updated_on' => '2007-03-23',
'bug_status' => 'FIXED'
);

$where = $table->getAdapter()->quoteInto('bug_id = ?', 1234);
$table->update($data, $where);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜