views:

122

answers:

5

I wonder if there's a useful library or lightweight framework only for database connectivity. What I need is something that lets me use a MySQL database with prepared statements in a secure way, without thinking a lot about gcc_magic_quotes and stuff like that. Something object oriented would be nice to have, with some convenience when fetching data from the DB. I don't want to employ a giant framework like cake or symfony just for that. It should be something really lightweight, just for this purpose.

Please, if you recommend something, write a little about it's pros and cons. That would be great! Thanks everyone!

+18  A: 

pdo

rick
I'd also recommend PDO.
ign
+1 PDO is the right way to go.
artarad
+3  A: 

You might want to check out Pear MDB2

bkoch
+4  A: 

MySQLi (note the i) supports prepared statements and it comes installed in most modern versions of PHP.

MindStalker
A: 

I use this one by Troy Wolf since years. Never failed me.

pixeline
Troy Wolf pointed out ADOdb. Looks great!!
openfrog
+2  A: 

PDO, MysqlI, PEAR MDB2, Doctrine(provides alot more), ADO for PHP. There are alot of options, but I would probably use PDO.

JC