Does PDO always use emulated prepared statements by default?(默认情况下,PDO 是否总是使用模拟准备好的语句?)
问题描述
PDO 有选项 PDO::ATTR_EMULATE_PREPARES
控制是否准备好仅当数据库不支持或始终不支持时才应模拟语句.但是,它没有提到它是否总是默认模拟它们.
PDO has the option PDO::ATTR_EMULATE_PREPARES
which controls if prepared statements should be emulated only if not supported by the DB or always. However, it does not mention if it always emulates them by default or not.
通常人们会假设仅在必要时才使用仿真,但由于它是 PHP,因此不能仅仅因为它是健全的就假设......
Usually one would assume that emulation is only used if necessary but since it's PHP nothing can be assumed just because it's sane...
推荐答案
取决于数据库驱动程序.它们总是默认模拟对于 MySql(当然您可以手动关闭该选项);在 Postgres 中,正确的默认设置是 动态检测.
Depends on the database driver. They are always emulated by default for MySql (although of course you can turn the option off manually); in Postgres the proper default setting is detected dynamically.
这篇关于默认情况下,PDO 是否总是使用模拟准备好的语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:默认情况下,PDO 是否总是使用模拟准备好的语句?


- PHP - if 语句中的倒序 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01