RE: [PHP-DB] mySQL - can connect with mysqlcc but not PHP code
| From: | Bastien Koert | Date: | Sat, 04 Dec 2004 05:49:55 +0000 |
| Subject: | RE: [PHP-DB] mySQL - can connect with mysqlcc but not PHP code | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37581@lists.php.net to get a copy of this message | ||
do you have the same user with the same permissions as the mysql cc user?
bastien
From: Bryan Green <bcgreen@yahoo.com> To: php-db@lists.php.net Subject: [PHP-DB] mySQL - can connect with mysqlcc but not PHP code Date: Fri, 03 Dec 2004 12:52:53 -0800 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php