Good Database Abstraction Layer for PHP

So I’m playing with this project that I’m working on last night, and I realized that I’ve completely forgotten everything I remember about database connections and querying MySQL from a PHP app (though I do remember Mark Hershenson who taught me most of what I used to know).

Regardless, after reading about thirty pages in my big red Professional PHP Programming and cross referencing a little in my old MySQL book. (It’s telling when your MySQL book was published in 1999, btw, isn’t it?), I decided that while I could easily retype all of the code in these books, and that would give me a good working knowledge of how DB operations work, I probably don’t need to do that much work.

Pear LogoSo, this morning, I searched for “php DB library” in Google, and I found the excellent Pear MDB2 database package, and I’m downloading it now to check it out.

I’d much rather download and use someone else’s library code for database abstraction than write my own at this point. Not only am I grossly out of practice, but while I’ve got a working app at this point (meaning I haven’t completely lost all of my coding skills) I’m far from being able to code without any reference material or example code from others…

That’s what I love about open-source projects. So much really high quality information out there about how to use it, what’s best, etc…

So, hopefully this weekend I’ll get a database system working, so I can tackle phase two of the coding (getting the data from my web forms into and back out of a database).

Update: I also found ADOdb, which Dreamhost recommends, so I’ll be checking that out too.

1 Response to “Good Database Abstraction Layer for PHP”

Leave a Reply