PHP supports the following databases in one form or another:
-
MySQL— www.mysql.com
-
mSQL— www.hughes.com.au
-
MS SQL (Microsoft SQL server; on Win32 systems only)
-
filePro (Read only)— www.fptech.com
-
Informix— (from IBM) www.informix.com
-
InterBase— www.interbase.com
-
Oracle— www.oracle.com
-
Ovrimos— www.ovrimos.com
-
Sybase— www.sybase.com
-
DB++—experimental— www.concept-asa.de
-
DBM— flat file databases available on many flavors of *nix
-
PostgreSQL— www.pgsql.com
-
Frontbase— www.frontbase.com
Basically, PHP has enough built-in support for a majority of
your database needs, especially since it contains support for the commercial
heavyweights, such as Oracle, Sybase, Informix, and Microsoft.
Unfortunately, each supported database has different functions
to do the same things. For example, to connect to a MySQL database you use the
function mysql_connect, and to connect to a MS SQL server you use mssql_connect.
The two functions are almost identical, but have different names.
This causes problems as far as code portability goes. Say, for
example, you have a killer app that you want to create, but management insists
that you use Microsoft's SQL server as the database back-end. However, you know
that MySQL or PostgreSQL will do the job just as well, and they are "free"
databases that run on the lovely Linux server you have hiding under your desk.
Wouldn't it be nice if you could code it once, then run your application using
any one of these databases with only the flip of a variable to tell PHP which
database it is talking to?
The PHP team has eliminated some of the problems with multiple
databases by creating a database abstraction layer called DBX. DBX allows you to
use one function that can, for example, connect to different types of
databases.