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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.