我的数据库包装程序应该使用哪个PHP扩展 [英] Which PHP extension should I use for my DB wrapper

查看:64
本文介绍了我的数据库包装程序应该使用哪个PHP扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个数据库包装程序供我自己使用,我无法决定应该使用哪个PHP扩展名PDO或MySQLi.

I'm building a database wrapper for my own use and I can't decide which PHP extension I should use, PDO or MySQLi.

我只打算使用MySQL,所以我不在乎对其他带有PDO的适配器的支持.我读过很多书,PDO正在成为PHP的标准",也许我应该使用它?然后我认为这太多了",因为我只使用了MySQL适配器.但是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对语言有耐心,我是个åäö(瑞典语)的人:)

P.S Have patience with the language, I'm an åäö (Swedish) kind of guy :)

推荐答案

尽管PDO应该/已经成为标准,但远非完美.
我每天都使用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).

无论如何,请查看报告的pdo和mysqli bug 分别为112和41.

If it is of any measure look at the reported bugs for pdo and mysqli: 112 and 41 respectively.

我的主观观点是:尽管有上述情况,但还是要使用PDO.我觉得它非常有用.

My subjective point of view is: despite the above, go with PDO. I find it very usable.

这篇关于我的数据库包装程序应该使用哪个PHP扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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