Also the following might give a more useful error message

$link=mysql_connect($hostname, $user, $pass)
echo mysql_errno() . ": " . mysql_error(). "\n";

Peter

-----------------------------------------------
Excellence in internet and open source software
-----------------------------------------------
Sunmaia
Birmingham 
UK
www.sunmaia.net
tel. 0121-242-1473
International +44-121-242-1473
-----------------------------------------------  

-----Original Message-----
From: Cassy M Rowe [mailto:cassy@;cassyrowe.com]
Sent: 04 November 2002 04:27
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Connecting to DB on separate server?


I have a php page on server #1 trying to access a database on server 
#2.  What do I put in the following blanks:

$hostname: ___________ (have tried IP, http, localhost, nothing works)
$username: blah
$password: blah
$database: _____________

$link=mysql_connect($hostname, $user, $pass) or die("Failure to 
communicate with database");

$close=mysql_select_db($database, $link);



All I get is the "Failure to communicate....."  message.

Server #1: ellerweb.eller.arizona.edu
Server #2: datamonster.sbs.arizona.edu
$database is cassy, but do I need to add anything to that?

I've tried asking two people who are really good at this and they have 
no answers.

THANK YOU IN ADVANCE!

Cassy Rowe


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to