Writing PHP code to work with any type of database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mastab0323
Forum Newbie
Posts: 3
Joined: Thu Jun 30, 2005 2:38 pm

Writing PHP code to work with any type of database

Post 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.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

http://adodb.sourceforge.net/

It's absolutely fantastic for database abstraction.
mastab0323
Forum Newbie
Posts: 3
Joined: Thu Jun 30, 2005 2:38 pm

Post by mastab0323 »

wow this is exactly what I needed. Thanks a lot, this is perfect.
Post Reply