I’m looking for a standard way to connect to databases in PHP. We’ve all been there – first start with some rudimentary code to connect/query/iterate/insert/disconnect, then the code grew as the program grew, and it ended up with a mess that’s hardly reusable.
I know there are many PEAR, PECL, and other PHP libraries/classes out there that can fit my description – but which ones are maintained, used, and have proven to be bug-free and efficient?
I’m supprised Zend_Db hasn’t been mentioned yet…
All of the above implement prepare and execute. Of the above, MDB2 is the most mature, as it’s been around for a long time and is based on DB and MDB. Zend_Db appears to be the most well thought out. I know there are others, but I don’t have experience or any knowledge about any of them.