But strangely I CANT connect to my DB if I put the hostname as my real hostname - mydomain.com . But if I use - localhost , it works. How come its working as- localhost when I am not on localhost.
Code: Select all
<?php
echo "HELLO WORLD";
$connect = mysql_connect("localhost","username","mypassword") or die ("couldn't connect db"); // it works
//$connect = mysql_connect("www.mydomain.com","username","mypassword") or die ("couldn't connect db"); // it DOESN'T work
?>