2

这是我的代码:

$update_data = array('post_browe_count'=>new Zend_Db_Expr('post_browe_count+1'));

$rowaffected = $contentmodel->update_post('posts',$update_data,$id);

我的课程直接从 Zend_Db_Table_Abstract 扩展,我该如何解决

4

1 回答 1

0

这里我给你一个使用产品和增加数量字段的例子:

$table     = 'products'; 
$data      = array('prd_qnty' => new Zend_Db_Expr('product_qnty + 1')); 
$where[] = $db->quoteInto('product_id = ?', $this->pr_id); 
$db->update($table, $data, $where);

只需尝试按上述方式进行查询。所以它肯定会为你工作。

让我知道我是否可以为您提供更多帮助。

于 2013-05-26T12:42:46.170 回答