Is there an database connectivity framework or library for PHP? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this questionI 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!
pdo
MySQLi (note the i) supports prepared statements and it comes installed in most modern versions of PHP.
You might want to check out Pear MDB2
PDO, MysqlI, PEAR MDB2, Doctrine(provides a lot more), ADO for PHP. There are a lot of options, but I would probably use PDO.
I use this one by Troy Wolf since years. Never failed me.
You can try my database wrapper, it extends PDO and have some nice features.
精彩评论