我应该为我的数据库包装器使用哪个 PHP 扩展
我正在构建一个供自己使用的数据库包装器,但我无法决定应该使用哪个 PHP 扩展,PDO 还是 MySQLi。
我只打算使用 MySQL,所以我不关心 PDO 对其他适配器的支持。我读过很多关于 PDO 正在成为 PHP 的“标准”的文章,也许我应该使用它?然后我认为它“太多”了,因为我只使用了 MySQL 适配器。但 MySQLi 会继续存在并得到进一步发展吗?
我知道有很多线程处理两者之间的差异,但我没有找到任何人回答我的问题。
PS 对语言要有耐心,我是一个 åäö(瑞典语)人:)
I'm building a database wrapper for my own use and I can't decide which PHP extension I should use, PDO or MySQLi.
I'm only planning to use MySQL so I don't care about the support for other adapters with PDO. I've read a lot that PDO is becoming a 'standard' with PHP and perhaps I should use that? Then I think it's 'too much' because I only have the use of the MySQL adapter. But is MySQLi going to stick around and be further developed?
I know there's a lot of threads dealing with the difference between the both but I didn't find anyone answering my question.
P.S Have patience with the language, I'm an åäö (Swedish) kind of guy :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尽管 PDO 应该成为/成为标准,但它远非完美。
我每天都使用 PDO,它存在相当多的错误(大多数你可以很容易地解决,但仍然如此)。
如果有任何措施,请查看报告的 pdo 和 mysqli 的 bug:分别为 112 和 41。
我的主观观点是:尽管如此,还是选择 PDO。我觉得它非常有用。
Although PDO is supposed to be/become The Standard, it is far from perfect.
I use PDO daily and it sports quite some bugs (most which you can quite easily workaround, but still).
If it is of any measure look at the reported bugs for pdo and mysqli: 112 and 41 respectively.
My subjective point of view is: despite the above, go with PDO. I find it very usable.
我建议如果您要使用大型应用程序,请使用 PDO,但对于小型应用程序,请使用 MySqli,因为如果您遇到任何问题,它会比 PDO 更容易调试,因为您不会使用任何其他数据库适配器
I would suggest if you are going for large scale applications go for PDO, but for small applications go for MySqli because if you get any problems it will be easier to debug than PDO as you are not going to use any other database adapter