MDB2 占位符简写与 DB->query
我刚刚意识到 pear:DB 扩展已被弃用,我正在努力将一些脚本更新到 MDB2。我对占位符的安排有多么麻烦感到有点失望。我错过了什么吗?是否有等效于 pear:DB 构造的简写:
$result = $db->query("SELECT * FROM table WHERE column1 = ? AND column2 = ?", array($column1, $column2);
据我所知,实现相同的结果(没有双关语意图)将需要几行代码并调用 MDB2-prepare()、MDB2->execute () 等...
MDB2 是否有可用的速记结构?
I just realized that the pear:DB extension is deprecated and I'm working on updating some scripts to MDB2. I'm a little disappointed how cumbersome the placeholder arrangement is. Am I missing something? Is there a shorthand available that is equivalent to the pear:DB construct:
$result = $db->query("SELECT * FROM table WHERE column1 = ? AND column2 = ?", array($column1, $column2);
As far as I can tell, achieving the same result (no pun intended) would require several lines and a call to MDB2-prepare(), MDB2->execute() etc....
Is any shorthand construct available for MDB2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,没有。您必须使用
prepare()
+execute()
。No, there is none. You have to use
prepare()
+execute()
.