For some reason I am getting the error
No database selected
I have no idea why this is not working, am I being blind?
$con = mysql_connect('localhost','myusername','mypassword');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db('mydatabase');
There are no typos in the actual username, password or database name and I can’t see a mistake in my code.
Suggestions are very much appreciated.
Thanks
Do you have
usernameadded to theusertable? What if you try the same code withrootuser?