Is there a database connection infrastructure or library for PHP?

I wonder if there is a useful library or a lightweight structure just for connecting to the database. I need something that allows me to use a MySQL database with prepared operations in a safe way, without thinking twice about gcc_magic_quotes and the like. It would be nice to have something object oriented, with some convenience when retrieving data from a database. I do not want to use a giant infrastructure like cake or symfony. It should be something really easy, just for this purpose.

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

+3
source share
6 answers
+24
source

MySQLi (pay attention to i) supports prepared statements and is installed in most modern versions of PHP.

+4
source

You can check Pear MDB2

+3
source

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

+3
source

I have been using this from Troy Wolf over the years. Never let me down.

+1
source

You can try my database wrapper , it extends PDO and has some nice features.

0
source

Source: https://habr.com/ru/post/1726275/


All Articles