原则:绑定 IN 参数

发布于 2024-09-14 07:39:03 字数 332 浏览 2 评论 0原文

我想知道是否可以将整数数组绑定为参数,这样我就可以做这样的事情?

$q = Doctrine_Query::create()
                    ->update('blah c')
                    ->set('ignored', true)
                    ->where('id in ?', array(1,2,3,4));

我想这是不可能的,因为它实际上使用数据库/PDO 绑定变量,而数据库/PDO 不支持它。

如果我在文档或其他问题中错过了这一点,我深表歉意。谢谢。

I was wondering if it is possible to bind an array of integers as a parameter, so I could do something like this?

$q = Doctrine_Query::create()
                    ->update('blah c')
                    ->set('ignored', true)
                    ->where('id in ?', array(1,2,3,4));

I guess that this isn't possible because it actually binds the variables using the database/PDO, which wouldn't support it.

Apologies if I have missed this in the documentation or another question. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文