I have written some code that is using mysqli_
a lot. The problem is that I now need to integrate this code with code that is using mysql_
, and takes care of connection, authentication etc. I don't want to create a second connection, but mysql_
lacks a few features, for example, prepared queries. So I'd like to somehow magically "import" the connection into mysqli
. Is this even possible? If so, how can that be done?
使用mysql_函数与mysql连接?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- duanquanzhi5560 2013-01-18 08:54关注
As F4r-20 pointed out, you could just change the way you connect to the database and replace the
mysql_
functions withmsqli_
ones!Try to decide what you are going to use BEFORE you start a project, not in the middle. Preparing saves a lot of time and issues like this.
PS. I would use PDO next time. It is easy, fast, OOP and supports multiple database types!
Edit: since you don't have access to the credentials or how you connect to the database, you will have to use
mysql_
, change the connection tomysqli_
or make a new connection... Sorry :(解决 无用评论 打赏 举报
悬赏问题
- ¥20 易康econgnition精度验证
- ¥15 线程问题判断多次进入
- ¥15 msix packaging tool打包问题
- ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
- ¥15 python的qt5界面
- ¥15 无线电能传输系统MATLAB仿真问题
- ¥50 如何用脚本实现输入法的热键设置
- ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
- ¥30 深度学习,前后端连接
- ¥15 孟德尔随机化结果不一致