Fatal error: Access denied
I have configured this for my local PHP testing server and for a remote connection but get the following error:
Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'root'@'localhost' (using password: NO) in /***/***/***/somedomainname.co.uk/subdomains/sitetesting/httpdocs/Connections/connDB.php on line 25
Fatal error: Access denied for user 'root'@'localhost' (using password: NO) in /***/***/***/somedomainname.co.uk/subdomains/sitetesting/httpdocs/Connections/connDB.php on line 25
Details have been altered for security.
In my connDB.php I have:
<?php
# FileName="WADYN_CONN.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connDB = "localhost";
$database_connDB = "vcb";
$username_connDB = "root";
$password_connDB = "";
@session_start();
$foundConnection = false;
if ($foundConnection == false) {
$domains = explode(",","somedomainname.co.uk/");
for ($domindex = 0; $domindex<sizeof($domains) && !$foundConnection; $domindex++) {
$domainCheck = trim($domains[$domindex]);
if (strpos(strtolower($_SERVER["SERVER_NAME"]),strtolower($domainCheck)) !== false && ($domainCheck == "" || strpos(strtolower($_SERVER["SERVER_NAME"]),strtolower($domainCheck)) == strlen($_SERVER["SERVER_NAME"])-strlen($domainCheck))) {
$hostname_connDB = "localhost";
$database_connDB = "testing";
$username_connDB = "testing";
$password_connDB = "*****";
$foundConnection = true;
}
}
}
$connDB = mysql_pconnect($hostname_connDB, $username_connDB, $password_connDB) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Can someone please see what is up with this. seems to me like it is not recognising the additional connection as it is still trying to connect using the local testing server db name, username and password.