17.2. DBX

The DBX extension provides a simple, universal interface to several relational databases. This disallows some special features of each database with the benefit of easily switching database servers. Of course, differences in the SQL the database server understands must be addressed in your scripts. There are alternatives to this extension written in PHP, including the one in PEAR. Listing 17.2 demonstrates the use of the DBX functions.

Marc Boeren added the DBX extension to PHP.

Listing 17.2. Using DBX
 <?php function myDBX_Order($a, $b) { return(dbx_compare($a, $b, "ID", DBX_CMP_ASC | DBX_CMP_NUMBER)); } //connect to MySQL server if(!($db = dbx_connect( DBX_MYSQL, 'localhost', 'ft3', 'freetrade', '', DBX_PERSISTENT))) { print("Unable ...

Get Core PHP Programming, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.