mySQL - can connect with mysqlcc but not PHP code
| From: | Bryan Green | Date: | Fri, 03 Dec 2004 20:52:53 +0000 |
| Subject: | mySQL - can connect with mysqlcc but not PHP code | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-37580@lists.php.net to get a copy of this message | ||
So here's the problem: I can connect to a mySQL database on localhost just
fine with a PHP test script I've written, but I cannot connect to a remote
server, even though I can connect to the remote server just fine with
mySQL Control Center. Anybody have any suggestions? Here's a snippet of my
code, if it helps:
-------------------------------------------------------
@ $db = mysql_pconnect($myhost, $myuser, $mypass);
if (!$db)
{
echo "Error: could not connect to DB."; exit;
}
mysql_select_db("test");
echo "Connection established!";
-------------------------------------------------------
And I have verified that the variables $myhost, $myuser, and $mypass
contain the correct connection data.
Thanks a million!
Bryan Green