I have an application written in C# and it does connect with the database.
Here's the error I'm getting:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'localhost' (using password: YES) in (php file) on line 15 Could not connect: Access denied for user 'username'@'localhost' (using password: YES)
Here is my code:
$mysql = mysql_connect("localhost", "username", "password");
if (!$mysql) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
I got this example from:
http://php.net/manual/en/function.mysql-connect.php
What am I doing wrong?
MySQLi
orPDO
instead.MySQL
is deprecated and is soon to be removed. – Amal Murali