- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的代码:
$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 扩展,我该如何解决它
最佳答案
我在这里给你一个使用产品和递增数量字段的例子:
$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);
只需尝试按上述方式进行查询。所以它一定对你有用。
如果我能为您提供更多帮助,请告诉我。
关于php - Zend_Db -> update() 将我的值递增两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16759145/
全部, 我编写了以下包装器,它扩展了 Zend_Db 类,为我的整个应用程序提供数据库连接。数据库连接工作正常,但从不同的类调用时无法执行查询。 class Testapp_DB extends Ze
有没有办法可以使用 Zend_Db 进行更新并跨多个(两个)数据库插入?例如, UPDATE database1.tableA AS a1, databse2.tableA as a2 SET a1.
我有一个长时间运行的查询,我尝试通过无缓冲的 pdo 语句来获取该查询(请参阅接下来的代码)。但是,当我“执行”无缓冲的查询,或者执行“fetchAll”时,计时(另见下文)并没有真正改变太多....
我有 2 个表 1 =“问题历史记录” 2 =“问题历史状态” “issue_history_id”是两个表中的列名称。 “issue_history”中的 PK 和“issue_history_st
当我阅读 J.Gilmore Zend 书籍(模型部分)时: class Game extends Zend_Db_Table_Abstract { protected $_primary='id'
不知道为什么我无法弄清楚这一点。基本上,我有两个具有多对多关系的表,所以我在它们之间有一个联结表。 例如,考虑以下数据库架构: Restaurant (id, restaurant_name, sub
采埃孚/PHP这是我的类(class)投票: class Votes extends Zend_Db_table { protected $_name = 'votes'; public functi
我正在使用此模型输出选择菜单的内容: $select = $this->select(); $select->order('name'); return $this->fetchAll($select
我一直在尝试使用 ZendFW 构建一个 sql 查询,但我似乎无法让它像我想要的那样运行(或根本无法运行)。这是我尝试使用 zend_db select() 构建的有效查询 SELECT tc.tr
我正在使用 Zend_Db 查询一个表。我有一些需要日期的 WHERE 子句,但不清楚(乍一看)如何“以正确的方式”执行此操作。 Zend_Db 是否提供了抽象,因此我不需要关心后端(Oracle、M
有没有办法在 Zend_db 中缓存结果集?例如,我想使用 Zend_db 运行一个选择查询,并希望这个查询被缓存以便以后能够更快地运行它。 最佳答案 我的建议是在 Bootstrap.php 中创建
我有两个表 registries 和 names。因此,我有两个模型类。我在注册表 模型中编写一个方法,我需要获取名称 表/模型中的所有名称。我是怎么做到的? 一个简单的 new Names() 应该
是否有与以下使用 Zend_Db 模块的 SQL 等效的语句? UPDATE items,month SET items.price=month.price WHERE items.id=month.
我有 3 个表: 用户[id, name, username, password, role] 事件[id, date, location, name] 参与者[id, userId, eventId
我收到错误: 消息: SQLSTATE[42000]:语法错误或访问冲突:1064 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本对应的手册,了解在 '%'Chinese'% 附近使用的
我有一个相当复杂的 SQL 查询,它对两个表执行计数。查询应如下所示: SELECT ((SELECT COUNT(DISTINCT(pages.id)) AS `count` FROM `p
嘿,有没有人知道过滤我从任何 Zend_Db 类获得的所有结果的最佳实践。 这是因为我有一个完整的数据库,时间戳为 INT,我想将字段更改为 Mysql 的 TIMESTAMP,而不必更改太多代码。
假设有这样的东西: SELECT energy_produced, energy_consumed, timestamp1 AS timestamp FROM ( SELECT max(energy_
我调用了一个模型,它只是一个标准类(不扩展 zend_db_table)。我正在做一个选择,并希望有可能排除一组将作为变量传入的 id。 我目前有以下内容: public function getIt
这是我的代码: $update_data = array('post_browe_count'=>new Zend_Db_Expr('post_browe_count+1')); $rowaffect
我是一名优秀的程序员,十分优秀!