If you do not supply a hostname, the default "localhost" is used. The host name has to be specifically specified if it is not localhost. If you are accessing an mySql on an ISP's server, you will have to ask your ISP the server on which MySql is running and the port. MySql's default port is 3306. IF your ISP is using a different port, this will have to be specifically used. Use this host and port number to connect.
An example:
Host : www.mySqlServerHost.com
User : phpUser
Password : phpPassword
The PHP command is :
mysql_connect("www.mySqlServerHost.com", "phpUser", "phpPassword");
If the ISP is using port 3330,
("www.mySqlServerHost.com:3330", "phpUser", "phpPassword");
Hope this helps.