Zend_Db_Select where() 和 Zend_Db_Adapter quoteInto()
Zend_Db_Select 的 where() 方法(当包含要完全进入的可选值时)和 Zend_Db_Adapte 的 quoteInto() 方法在转义 SQL 方面基本相同吗?
换句话说,这两段引用是否相同且同样安全?
$select->where($this->getAdapter()->quoteInto('id = ?', 3));
$select->where(id = ?, 3);
谢谢!
Are Zend_Db_Select's where() method, when including the optional value to quite into, and Zend_Db_Adapte's quoteInto() methods basically the same as far as escaping SQL?
In other words, are these two pieces of quote identical and equally secure?
$select->where($this->getAdapter()->quoteInto('id = ?', 3));
$select->where(id = ?, 3);
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Zend_Db_Select::_where() 使用 Zend_Db_Abstract::quoteInto() 引用您在组装 sql 字符串时在 Zend_Db_Select::where() 中指定为第二个参数的值。
来自 Zend_Db_Select 的第 983 行:
Zend_Db_Select::_where() is using Zend_Db_Abstract::quoteInto() to quote the value(s) you specify as the second parameter in Zend_Db_Select::where() when assembling the sql string.
From line 983 of Zend_Db_Select:
据我了解,这已经在哪里了,所以指定它是多余的。
As I understand it where does this already so specifying it would be redundant.