This commit is contained in:
2007-12-15 02:19:09 +00:00
commit 66ca16f8b0
24 changed files with 1199 additions and 0 deletions

21
code/db_mysql.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
/*
* MySQL Database wrappper
*
*/
if( $_config['db'] == 'mysql' ) {
// Egress checking, make sure everyting we need is available
if( !class_exists( 'mysqli' ) ) throw new ConfigException('Missing required PHP Extension "mysqli".');
if( !is_array( $_config['mysql'] ) ) throw new ConfigException('Missing configuration data: mysql');
// Connect to the database using the config variables provided in _config
$_db = new mysqli( $_config['mysql']['host'], $_config['mysql']['username'], $_config['mysql']['password'], $_config['mysql']['database'], $_config['mysql']['port'] );
if( mysqli_connect_errno() ){
throw new ConfigException('Cannot connect to the mysql database');
}
}
?>