可以同时使用MySQLi和PDO吗? [英] Is it possible to use both MySQLi and PDO?

查看:100
本文介绍了可以同时使用MySQLi和PDO吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以同时使用MySQLi和PDO?例如,要使用MySQLi插入数据,然后在项目的其他部分使用PDO选择并使用它?我在MySQLi中有很多插入/更新代码,但决定切换到PDO吗?

Is it possible to use both MySQLi and PDO ? For example, to insert data using MySQLi and then select and work with it using PDO in other part of the project? I have a lot of insert/update code in MySQLi, but decided to switch to PDO?

推荐答案

是的,有可能.但是请记住,在任何情况下,您都将有两个完全分开的与MySQL服务器的连接. mysqli_ *和PDO_MySQL扩展不能(当前)共享一个连接,即使它们使用相同的传输驱动程序( MySQLnd )

Yes, it's possible. But keep in mind that you'd have two completely separated connections to the MySQL server in any case. The mysqli_* and PDO_MySQL extensions cannot (currently) share a single connection even though they use the same transport driver (MySQLnd)

这篇关于可以同时使用MySQLi和PDO吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆