I'm uploading my website on HostGator, but I have a problem with MySql, i get this error :
Access denied for user 'hostgatoruser'@'localhost' (using password: NO)
And this is my php code :
try
{
$DB = new PDO('mysql:host=localhost;dbname=hostgatoruser_database', 'hostgatoruser_abc', '********');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
Why the error tells me Access denied for user "hostgatoruser@localhost" instead of "hostgatoruser_abc" ? How to fix it ?
EDIT: OK, the problem was caused by the mysql_real_escape_string functions, so I removed them. I still dunno why I can't use mysql_real_escape_string...