Page 1 of 1

Writing PHP code to work with any type of database

Posted: Thu Jun 30, 2005 2:40 pm
by mastab0323
I'm developing software in PHP that needs to be able to work with different types of databases, not just MySQL. If their server has PostRegSQL, MSSQL, MySQL, etc. all of my queries in my php code should still work properly. Essentailly when they set up the software I'm going to have them specify what type of database they want to use.

I found this class and I'm not sure this will solve my problem.

http://www.phpclasses.org/browse/file/3637.html

In other words I want to be able to do pass this through a class:

SELECT * from table_name

and depending on the database type it would work the same no matter what kind of database they are using.

If you know where I can get a class to pass all of my queries through that would be perfect. Any help is greatly appreciated. Thanks.

Posted: Thu Jun 30, 2005 2:48 pm
by Roja
http://adodb.sourceforge.net/

It's absolutely fantastic for database abstraction.

Posted: Thu Jun 30, 2005 3:52 pm
by mastab0323
wow this is exactly what I needed. Thanks a lot, this is perfect.