I have the following problem, I am trying to connect to the database with pdo in HostGator but I receive the following error:
Error: SQLSTATE [28000] [1045] Access denied for user 'digital_chuser' @ 'localhost' (using password: YES)
My connection code is:
<?php
try {
$con = new PDO('mysql:host=localhost;dbname=digital_chdb','digital_chevuser','TK$JhM,XV&tD>');
} catch (PDOException $e)
{
echo 'Error: '. $e->getMessage();
}
?>
At the end I have this other message:
Fatal error: Call to a member function prepare () on null in /home3/digital/public_html/chevistar/index.php on line 6
I have created the database and user in the MySQL Databases section and added that user to the database, when I go to PHPMYADMIN I see the database created with their tables, however when I check MYSQL Databases it appears as a database empty is not there is the track.