Page 1 of 1

how can we connect 2 a remote mySQL Database

Posted: Thu Sep 05, 2002 5:55 am
by saadatshah
Hi All,
i need 2 connect with a remote mySQL database......can any1 help me doin this....


advance thx 2 all

----------
Saadi
----------

Posted: Thu Sep 05, 2002 6:05 am
by twigletmac
The same way that you connect to a local one using mysql_connect() except the host name will be something other than localhost, it will be the name of the remote mysql server (or its IP address).

To connect to a remote server, your IP address or domain has to be given the right to connect under your username and password.

Mac

Posted: Thu Sep 05, 2002 7:46 am
by Takuma
So like this:-

Code: Select all

<?php
mysql_connect("www.remotehost.com","root","123");
?>