PHPLIB accesses SQL databases through a class named DB_Sql. You include the
version for your database in your code. I use the MySQL version in this
To get DB_Sql in to your code, install the PHPLIB files in their own
directory. Then, find your cgi-bin directory and create the phplib directory next
to the cgi-bin directory. Next, copy all the PHPLIB .inc files in to the phplib
directory. Finally, put the phplib directory in to the php.inc file in the line
starting with include_path =.
The include_path is where PHP grabs files named in include() or require().
On my NT workstation, the include path is...
Read the PHPLIB documentation at http://phplib.netuse.de and the fine
articles at http://www.phpbuilder.com to find out which includes you need.
Db_mysql.inc contains the DB_Sql class definition. If you want to use
PostGreSQL instead of MySQL, include db_pgsql.inc instead of db_mysql.inc.
There are 10 .incs covering MS SQL, Oracle, Sybase and others.
*Note that for this example, require() and include() are exactly the
same. Require() and include() do work differently and have different
results when used in the middle of your code or in if() statements.