this is a really stupid question and this is the only script I've wrote where I've had this problem, but mysql_connect isn't working right for me. If I call it like the following, it works:
mysql_connect("localhost","user","pass");
but if I try this, it wont connect:
require("./config.php");
mysql_connect($host,$user,$pass);
config.php file:
$host="localhost";
$user= "user";
$pass= "pass";
$db="db";
I've tried this on different servers and I keep getting access denied for user root (USING Password NO). I've also tried defining the variables right before the connect call and that doesn't work either, so it's not a problem with the included file.
It also does the same when selecting the DB. I can select it through
mysql_select_db("db");
but not through
mysql_select_db($db);
any ideas? this is really annoying me