Hey,
I tried to connect a database of Mysql with a phpfile, but I keep getting this strange message. I have a cPanel account on a university network. Here is the php code that I use to connect with the database(which I made correctly, made a username and connected it to the database and gave all privilages):
<html>
<body>
<?php
mysql_connect("localhost", "DataBname", "PassW") or die(mysql_error());
echo "Connected to MySQL<br />";?>
</body>
</html>
However, I keep getting this message:
"Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'DataBname'@'localhost' (using password: YES) in /webusers/ph6theo/public_html/index.php on line 7
Access denied for user 'DataBname'@'localhost' (using password: YES)"
On the cPanel main menu, it says the server name is "descartes"
When I try the same code and insert 'descartes' instead of 'localhost' I get the same message with 'descartes' instead of 'localhost' in this message.
Why isn't this working?