O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required