在PDO,MySQLi和传统mysql之间进行选择 [英] Choosing Between PDO, MySQLi and traditional mysql

查看:74
本文介绍了在PDO,MySQLi和传统mysql之间进行选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复: mysqli或PDO-优缺点是什么?

大约八个月前,我开始了一个项目.我已经深入到这个项目了.但是,该项目是使用传统的mysql语法开发的.直到最近,我才开始遇到 PDO

I started a project about eight months ago. I have already gone far into the project. However, the project have been developed using the traditional mysql syntax. Until recently I started coming across PDO and MySQLi.

我也已经阅读了传统的mysql的使用方法是如何被折旧的,并且可能无法与MySQL数据库上的进一步更新一起使用.我有点困惑.我不知道是否应该在将以前使用的传统mysql更改为PDO或MySQLi(如果是的话,最好是PDO或MySQLi以及为什么?)之间进行选择,还是应该继续使用传统的mysql?

I have also read how the use of the traditional mysql is being depreciated and may not work with further updates on the MySQL database. I am a bit confused. I do not know if I should choose between changing the traditional mysql I have used to either PDO or MySQLi (if yesm, which is better, PDO or MySQLi and why?) or if I should continue with the traditional mysql.

推荐答案

虽然切换到PDO没什么大不了的,也不会花那么长时间,而对于8个月的项目,我必须有一个星期的截止日期建议不要在平均时间内切换到PDO.

While switching to PDO is not that big of a deal and wouldn't take that long, with a one week deadline on an 8 month project I would have to advise against switching to PDO for the mean time.

您将需要进行一些测试,以确保一切正常,并且由于只剩一个星期的时间,您可能还需要先完成其他一些小事情.

You are going to have a fair bit of testing to make sure everything is working well, and since you only have a week left you probably have other small things you need to finish up first.

在启动和下一个次要版本升级后,无需再切换到PDO,这样您就有更多的时间进行测试.

Save switching to PDO for after the launch and the next minor version upgrade so that you have more time for testing.

同时,我建议切换到mysqli,因为另一个答案说,在mysql_到mysqli_上进行strreplace很容易

In the meantime I would suggest switching to mysqli since as another answer says, doing a strreplace on mysql_ to mysqli_ is easy

这篇关于在PDO,MySQLi和传统mysql之间进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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