ADOdb v. PEAR

By Randal Rust

I'm working on a site that will eventually be hooked up to a Microsoft SQL database, but I don't have the database yet, and I need to write scripts and create some basic table functionality.

In order to move forward, I've created parts of the database in MySQL, and begun writing my scripts. It's been quite a learning experience. Today I learned about SQL Injection and how to avoid it. Mostly it can be done be checking values with regular expressions.

Now eventually I'll have to rewrite all of my scripts for MS SQL, instead of MySQL, unless I figure out how to use one of the database APIs for PHP. There seem to be two main options - Pear and ADOdb.

Pear is what most PHP programmers seem to be using. But I can't even figure out how to install it on Windows, which is really annoying. I was able to get ADOdb installed and working in about two minutes, so I guess that's what I'll be using. The only problem is that the documentation stinks.

But, the benefit is that when I finally get the MS SQL database, I'll will only have to change the database connection parameters and everything will still work. Just like magic. We'll see.