I have index.php that requires config.php, and sql.php.
Config.php has the database credentials and sql.php has the following code
$errormessage = "<center><h2>Sorry.</h2><br />Service unavailable, please contact to the administrator.</center>";
$db = @mysql_connect($db_connect_info["dbhost"], $db_connect_info["dbuser"], $db_connect_info["dbpassword"]) or die ($errormessage);
@mysql_select_db($db_connect_info["dbname"],$db) or die ($errormessage);
This is an older script that im trying to use. Not sure if it's outdated or not. I did test my credentials to the database were correct by using a simple script.
mysql_connect('db_host', 'myuser', 'password') or die('Could not connect the database : Username or password incorrect');
mysql_select_db('esudmanager') or die ('No database found');
echo 'Database Connected successfully';