Skip to Content.
Sympa Menu

freetds - Re: [freetds] Support for many database systems

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT axelero.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Support for many database systems
  • Date: Tue, 9 Mar 2004 18:50:24 +0100

If I want the freetds supports the following databases:
1, MySQL
:-O... FreeTDS support Sybase (ASE/ASA) and Microsoft SQL Server. If you
want to access all these DB in a portable way you can use ODBC and
related drivers.
Dear freddy77,
Does the ODBC or which related drivers support with php for all these
database systems ?
Thank for your tell !

You have to decide whether you want to use

a) a completely different set of functions to access each of the different databases
b) some kind of a database abstraction layer

PHP has native support for all of the DBMS you listed, so you could do what most people do when portability between different databases is not a priority and use those:

http://www.php.net/mysql
http://www.php.net/pgsql
http://www.php.net/oci8
http://www.php.net/sybase
http://www.php.net/mssql

Each of these except for MySQL require you to have some kind of database client libraries installed on your system before you can build the PHP extensions. Normally these are provided by the database vendor, however, Microsoft not too surprisingly has no intentions of supporting any other platform besides Windows. That's exactly where FreeTDS fills the void.

After you gathered all the necessary client libraries and have a PHP which now supports the native interfaces of each, you can still go with one of the many database abstraction layers. In fact, the existence of the native interfaces is a prerequisite for most.

The official ones are:
http://www.php.net/dbx
http://pear.php.net/package/DB

There are numerous unofficial ones as well.

And then we have ODBC, a somewhat different kind of beast. Instead of the former client libraries, you need ODBC drivers and an ODBC driver manager such as unixODBC.

The ODBC drivers are again usually provided by the database vendor, albeit most often as a separate download available from their website, eg. MyODBC for MySQL. FreeTDS also doubles as a suitable ODBC driver for Sybase and MS SQL Server.

After this, you can use the ODBC extension in PHP:
http://www.php.net/odbc


In the end you have so many choices it's almost a classic case of too much of a good thing.

--
fds





Archive powered by MHonArc 2.6.24.

Top of Page