Not sure what is going on, my mysql_connect.php was working fine up until today and now (without me changing any of the code structure) it is pulling up this fatal error:
Fatal error: Call to undefined function: my_error_handler() in /home/wowinfo/public_html/incl/mysql_connect.php on line 31
Here is mysql_connect.php
// Set the database access information as constants.
DEFINE ('DB_USER', 'xxxxxxx');
DEFINE ('DB_PASSWORD', 'xxxxxxx');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'xxxxxxx');
if ($dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD)) { // Make the connnection.
if (!mysql_select_db (DB_NAME)) { // If it can't select the database.
// Handle the error.
my_error_handler (mysql_errno(), 'Could not select the database: ' . mysql_error());
// Print a message to the user, include the footer, and kill the script.
echo '<p><font color="red">The site is currently experiencing technical difficulties or you have reached this page in error. We apologize for any inconvenience.</font></p>';
include_once ('incl/footer.html');
exit();
} // End of mysql_select_db IF.
} else { // If it couldn't connect to MySQL.
// Print a message to the user, include the footer, and kill the script.
// This is line 31
my_error_handler (mysql_errno(), 'Could not connect to the database: ' . mysql_error());
echo '<p><font color="red">The site is currently experiencing technical difficulties. We apologize for any inconvenience.</font></p>';
include_once ('incl/footer.html');
exit();
} // End of $dbc IF.
// Function for escaping and trimming form data.
function escape_data ($data) {
global $dbc;
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string (trim ($data), $dbc);
} // End of escape_data() function.