Your remote server has PHP/MySQL setup? Your DB hostname may be different from Localhost but basically your php connection string should just reflect what host username and password you need to use to connect to your DB. DNS has nothing to do with it.
For example this function will connect to *any* mysql database *anywhere* provided the correct variables are inputted simply by calling db_connect(). What I usually do is put this function in a secure place and tell every page which needs a DB connection to include the page ie. include ('secure/db_fns.php'); then just call it. function db_connect() { $LocalHost = "your_host_name"; $User = "username"; $Password = "password"; $DBName = "name_of_db"; $result = @mysql_connect("$LocalHost", "$User", "$Password")or die("Could not connect to the database"); if (!$result) return false; if ([EMAIL PROTECTED]("$DBName")) return false; return $result; } What it sounds like your problem is, is that you don't know what your new hostname/username/password etc is. They will likely be different on your new server. If it's remotely hosted ask your administrator what these variables are. If you have admin and root rights you should be able to configure your password and find out the information yourself. Regards, Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 > -----Original Message----- > From: Jason Wong [mailto:[EMAIL PROTECTED] > Sent: 28. maaliskuuta 2003 15:24 > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Connecting to a remote server > > > On Friday 28 March 2003 21:06, Roberts, Mark \(Tulsa\) wrote: > > They are not on the same server...that is the problem. > > They used to be on the same server, but I have had to move the > > application to a physically different server with a > different DNS than > > the DB Server. > > > > So, on the surface, it would seem that I should just replace > > 'localhost' with the dns name of the DB Server i.e. > > (http://www.xyz.com). However, this did not work. Is there > something > > else that I should be doing, either in the connect string or in php > > configuration? > > > Please read my original reply: > > > Are you talking about the database connection? If so, then > there is no > > need for the 'http://'. And if both the webserver and the DB server > > are on the same machine you can continue to use 'localhost'. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications > Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > > ------------------------------------------ > /* > This is probably the first and last time I will openly agree > for someone to tell me were to go, and do it ;-). > > - Andre Hedrick on linux-kernel > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php