Hello, all! I am having a few troubles with my database connection...
The error I am getting:
My Connection:
The error I am getting:
Warning: mysql_real_escape_string(): Access denied for user 'clanmsx2'@'localhost' (using password: NO) in /home/clanmsx2/public_html/xxxx/xxxxxxx on line 5
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/clanmsx2/public_html/xxxx/xxxxxxx on line 5
Warning: Cannot modify header information - headers already sent by (output started at /home/clanmsx2/public_html/xxxx/xxxxxxx:5) in /home/clanmsx2/public_html/xxxx/xxxxxxx on line 17
My Connection:
PHP:
$config['db'] = array(
'host' => 'localhost',
'username' => 'clanmsx2_xxxxxxxxx',
'password' => 'xxxxxxxxxxxxx',
'dbname' => 'clanmsx2_xxxxxxxxx'
);
try {
$pdo = new PDO('mysql:host=' .$config['db']['host']. ';dbname=' .$config['db']['dbname'], $config['db']['username'], $config['db']['password']);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec("SET CHARACTER SET utf8");
} catch(PDOException $e) {
exit(var_dump($e->getMessage()));
}