I have this code in my site, I am running it with apache and my php, mysql, and apache seem to all be working fine, but when I try to call databases, I cannot connect to SQL.
<?php
$conn = mysql_connect('localhost', 'host', '*****');
if (!$conn) {
die('Not connected : ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($conn);
?>
I'm positive that my password is correct, and I believe that my username is host, but I am not sure. When I connect the phpmyadmin my username is host and it works fine.
When I run my site, I get this message:
Not connected : Access denied for user 'host'@'localhost' (using password: YES)
I'm not sure how to troubleshoot this because everything I find says check the variables, and they all seem to be right.
Thank you!!!