Best database class or function for PHP?

I'm going to start writing new software with PHP, and I need to know what is the best way to use the database. Should I choose a database class such as adodb, ezSql, etc.

Which class do you think is the best?

+4
source share
5 answers

It depends on whether you need an ORM or just a database abstraction layer. If you use the Zend Framework , then Zend_Db is a great choice. Propel ORM is a great ORM for PHP. Doctrine is another great ORM library. On the other hand, if you need only an abstraction layer, consider using a built-in PDO or libraries such as PEAR MDB2 .

+4
source

The simplest and easiest db class is

http://code.google.com/p/edb-php-class/

 <?php $result = $db->q("select * from `users`limit 3"); foreach($result as $a){ $a = (object) $a; echo $a->id.' '.$a->name.' '.$a->url.' '.$a->img.'</br>'; } $result = $db->line("select * from `users` where id = '300' limit 1"); echo $result['name']; echo $result['surname']; $name = $db->one("select name from `ilike_pics` where id = '300' limit 1"); echo $name; ?> 
+3
source

I would recommend using the PHP PDO (PHP Data Objects) extension along with a lightweight database class that extends PDO. You can find this open source project on Google Project Hosting at http://code.google.com/p/php-pdo-wrapper-class .

+3
source

ADOdb . Quickly, easily implemented, well-documented (not like in the read code for understanding) and does nothing that you do not want to do.

+1
source

Alternative ADOdb:

https://open-mv.googlecode.com/svn/trunk/

It’s not so difficult to document at the moment.

+1
source

All Articles