Re: mysql_connect

From: Date: Thu, 04 Nov 2004 08:10:30 +0000
Subject: Re: mysql_connect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201134@lists.php.net to get a copy of this message
Hi Ben , $connection = mysql_connect$host,$user,$password); if(!$connection) echo echo mysql_error(); After checking error msg . I can help you --Mannoj Kr. Sheoran ----- Original Message ----- From: "Ben Miller" <benipmiller@comcast.net> To: "php-general" <php-general@lists.php.net> Sent: Thursday, November 04, 2004 11:52 AM Subject: [PHP] mysql_connect > 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."); > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#201134) next »