Hey all
I can connect with $conn =
mysql_connect(IP_Address,username,password);
but I can't connect with
$host = IP_Address;
$user = username;
$pass = password;
$conn = mysql_connect($host,$user,$pass);
Any ideas? All I get is Can't connect to MySQL Server on 'localhost',
(!), and it's working, but the original problem has still got me
confused!!!
Dave
-Original Message-
From: Brunner, Daniel [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 21:32
To: Dave Watkinson
Subject: RE: [PHP-DB] Weird Problem In mysql_connect();
Hello!!
Have your tried to echo
To: PHP-DB List (E-mail)
Subject: RE: [PHP-DB] Weird Problem In mysql_connect();
yeah - everything's fine! All the variables are being stored, but
they're not getting passed to mysql_connect() for some really strange
reason!
:-(
I've done a temporary fix - moved the entire database
!
Dave
-Original Message-
From: Brunner, Daniel [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 21:32
To: Dave Watkinson
Subject: RE: [PHP-DB] Weird Problem In mysql_connect();
Hello!!
Have your tried to echo the $host??
like
$host=123.100.321.1
echo $host;
Dan
--
Fr
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Weird Problem In mysql_connect();
You mean you had all this inside a function? Like:
function dbConnect ()
{
$link = mysql_connect($host,$user,$pass);
}
?
If so, did you pass $host, $user, and $pass to the function by
global-ing
them like:
function
JH has it right - your function has no idea what $host, $user, and $pass
are, because they're out of scope. Add the global statements that
Jonathan suggested inside your dbConnect function, and all will be well.
Dave Watkinson wrote:
function dbConnect (){
$link =