views:

42

answers:

4

Are there any great, lightweight MySQL connection classes out there for PHP that anyone recommends?

I have written my own, and I do think it is pretty good but this seems like the sort of thing that many programmers better than me must have perfected long ago.

I'm interested in finding something that I can slot in generically and use as I need it with as little hassle as possible.

Some generic functions to support querying, connecting to multiple MySQL databases within the one application would also be a plus.

+3  A: 

Have you had a look at PDO? http://php.net/manual/en/book.pdo.php

Andrei Serdeliuc
A: 

May try ADOdb and ADOdb Lite

P.j.Valle
+1  A: 

A class of my own invention: DB

It may be called very lightweight (less than 100 lines of code). It is a wrapper around PDO and it actually only adds a very handy way of escaping variables and a short syntax (DB::query() instead of DB::instance()->query().)

But this short syntax results in it being limited to once connection.

nikic
A: 

this is a very neat and easy to use class: http://www.woyano.com/jv/ezsql

wordpress database class is also derived from the above class

ovais.tariq