/* --------------------------------------------------------------------- Copyright (c) Project Skyline, Partnership of Ben Sgro & Devin Bousquet, with operations in NH & NY, 2005-2006. All Rights Reserved. Published rights reserved under the copyright laws of the United States. This software and any other software contained on this media is proprietary to and embodies the confidential technology of Project Skyline, Partnership. Possession, use, duplication or dissemination of the software and media is authorized only pursuant to a valid written license from Project Skyline, Partnership. Written by: Ben Sgro, ProjectSkyline[dot]com, 2006. RELEASED. --------------------------------------------------------------------- */ define('constDebug', 0); define('constDatabaseUser', 'mysql_user'); define('constDatabasePass', 'mysql_pass'); define('constDatabaseName', 'myDatabase'); function INDX_SQLInfo( ) { return array ( 'databaseUser' => constDatabaseUser, 'databasePass' => constDatabasePass, 'databaseName' => constDatabaseName, ); } /* DBAS_MySQLConnect Attempts to pconnect to to the database specified in $sqlSet. Returns a valid handle to $db or an error code. Logs to the php error log file if debugging is on, or if an error is encountered. */ function DBAS_MySQLConnect($sqlSet, &$db) { $cIp = (constDebug)? $_SERVER["REMOTE_ADDR"] : ''; $dbName = (constDebug)? $sqlSet['databaseName'] : ''; $dbUser = $sqlSet['databaseUser']; $dbPass = $sqlSet['databasePass']; $db = mysql_pconnect("", $dbUser, $dbPass); if ( $db ) { if ( constDebug ) error_log("DBAS: $cIp connected to $dbName"); } else { $dbName = $sqlSet['databaseName']; $cIp = $_SERVER["REMOTE_ADDR"]; error_log("DBAS: $cIp error connecting to $dbName"); } } DBAS_MySQLConnect($db, INDX_SQLInfo( )); /* Now we can use the $db handle */