I've seen a few errors like this, but I found no answer.
Unable to connect to database: Access denied for user ''@'localhost' to database 'socialdb'
socialdb is my database. The "Unable to connect to database:" part is located here.
$db = mysql_select_db("socialdb",$con);
if(!$db) {
die ('Unable to connect to database: ' . mysql_error());
}
I don't know what's causing this. Here are my mysql_connect details
<?php
$con = mysql_connect("localhost");
if(!$con) {
die ('Error: ' . mysql_error());
}
I need to find the root. Thanks.
I DON'T HAVE A USERNAME OR PASSWORD FOR MySQL
Should it be this?
mysql_connect("localhost","","");