Re: mysql_connect

From: Date: Thu, 04 Nov 2004 14:46:55 +0000
Subject: Re: mysql_connect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201125@lists.php.net to get a copy of this message
On Thursday 04 November 2004 06:22, Ben Miller wrote: > I am having trouble connecting to a database on another server. I have the > following for the connection, but it seems to be overriding the value for > the $host variable, and replacing it with localhost. Anyone got any ideas? > > $host="domain.com"; > $user="username"; > $password="password"; > $database="dbname"; > $connection = mysql_connect($host,$user,$password) > or die ("Couldn't connect to server."); > $db = mysql_select_db($database,$connection) > or die ("Couldn't select database."); What does mysql_error() say? -- 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 ------------------------------------------ /* The man on tops walks a lonely street; the "chain" of command is often a noose. */

« previous php.general (#201125) next »