Notice: Could not select the database!
MySQL Error: Access denied for user 'username'@'localhost' to database 'database' in /home/site/mysql_connect.php on line 11
Above is the error message I get, does anyone know what that may mean? I created a mysql_connect INC file and I put it in a top level directory, now I want to use it to access a MySql database using PHP and I get the error message.
Below is part of the mysql_connect.php file
<?php //mysql_connect.php
DEFINE ('DB_USER', 'username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'database');
if ($dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD)) {
if (!mysql_select_db (DB_NAME)) {
//echo 'ERROR Selecting Database';
trigger_error("Could not select the database!\n
MySQL Error: " . mysql_error());
exit();
}
} else {
//echo 'ERROR connecting to database';
trigger_error("Could not connect to MySQL!\n
MySQL Error: " . mysql_error());
exit();
}