简体   繁体   English

在无法使用PDO的情况下使用MySQL时,应该使用哪个梨子MDB2或pear DB_DataObject?

[英]Which should I use, pear MDB2 or pear DB_DataObject when I use MySQL when I can not use PDO?

Almost all of free web hosting server, 几乎所有免费的虚拟主机服务器,

you can not use PDO + MySQL. 您不能使用PDO + MySQL。

They lack PDO drivers. 他们缺少PDO驱动程序。

So I am considering to select 所以我正在考虑选择

pear MDB2, 梨MDB2,

or DB_DataObject. 或DB_DataObject。

Which do you reccomend to me? 你推荐给我哪一个?

Give me your opinions! 给我你的意见!

I would actually recommend using the Mysqli functions if you can. 如果可以的话,我实际上建议使用Mysqli函数。 They are fast, well-documented and well supported by the php community at large. 它们是快速的,有据可查的,并且得到了php社区的广泛支持。

If you are looking for a more robust database abstraction layer, I would first suggest that you look at any of the excellent library's out there like DataMapper, or Propel or Doctrine, or even using the necessary portions of a framework like Zend. 如果您正在寻找一个更强大的数据库抽象层,那么我首先建议您查看其中任何出色的库,例如DataMapper,Propel或Doctrine,甚至使用Zend等框架的必要部分。 As further note, I've used Adodb in the past, but haven't seen much support for it recently. 还要注意的是,我过去曾经使用过Adodb,但最近没有看到太多的支持。

我已经使用了MDB2了很多,但是发现内置的mysqli函数既快速又易于使用,而且它们可以轻松地集成到自己拥有的db抽象层中。

ADOdb is also good. ADOdb也很好。

The PHP version currently supports an amazing number of databases, thanks to the wonderful ADOdb community: MySQL, PostgreSQL, Interbase, Firebird, Informix, Oracle, MS SQL, Foxpro, Access, ADO, Sybase, FrontBase, DB2, SAP DB, SQLite, Netezza, LDAP, and generic ODBC, ODBTP. 由于出色的ADOdb社区,PHP版本目前支持数量惊人的数据库:MySQL,PostgreSQL,Interbase,Firebird,Informix,Oracle,MS SQL,Foxpro,Access,ADO,Sybase,FrontBase,DB2,SAP DB,SQLite, Netezza,LDAP和通用ODBC,ODBTP。 The Sybase, Informix, FrontBase and PostgreSQL, Netezza, LDAP, ODBTP drivers are community contributions. Sybase,Informix,FrontBase和PostgreSQL,Netezza,LDAP,ODBTP驱动程序是社区的贡献。

DB_DataObject depends on MDB2, so you have to have it anyway. DB_DataObject依赖于MDB2,因此无论如何都必须拥有它。

The question is : do you need just bare database independence or more advanced ORM (that's DB_DataObject). 问题是:您只需要裸露的数据库独立性还是更高级的ORM(即DB_DataObject)。

I'd suggest you stick with MDB2 since you seem confused about this stuff. 我建议您坚持使用MDB2,因为您对此东西似乎感到困惑。

您可以将DB_DataObjectMDB2 一起使用而不会出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM