I am having problem with connecting to Database in hostforlife.eu. I do not know if it is my code that is giving the problem or my host provider that is giving the problem. I tried 2 different ways of coding to connect to database;
Below is the working code:
Below is the non-working code:$hostname = "xxx.db.xxx.mysite.com";
$username = "xxx";
$dbname = "xxx";
$password = "xxx";
mysql_connect($hostname, $username, $password) OR DIE ("Unable to
connect to database! Please try again later.");
mysql_select_db($dbname);
Or is it because hostforlife can't use define function? Thanks guys.define("DBHOST","xxx.db.xxx.mysite.com");
define("DBNAME","xxx");
define("DBUSER","xxx");
define("DBPASS","xxx");
mysql_connect(DB_HOST,DB_USER,DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());