Re: Trouble with mysql_pconnect unable to connect to database?

From: Date: Sun, 24 Mar 2002 04:29:46 +0000
Subject: Re: Trouble with mysql_pconnect unable to connect to database?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-89897@lists.php.net to get a copy of this message
Is that supposed to be -> $db = @mysql_pconnect("localhost", "bookorama", "bookorama123"); Jim Hankins wrote:
I'm doing a simple database connection using the follow syntax: <html> <head> <title>Book-O-Rama Search Results</title> </head> <body> <h1>Book-O-Rama Search Results</h1> <? if (!$searchtype || !$searchterm) {
     echo "You have not entered search details.  Please go back and try
again.";
     exit;
} $searchtype = addslashes($searchtype); $searchterm = addslashes($searchterm); @ $db = mysql_pconnect("localhost", "bookorama", "bookorama123"); if (!$db) {
     echo "Error: Could not connect to database.  Please try again later.";
     exit;
} When I go to the search page and hit submit (after removing the @ to see an error on the mysql_pconnect line) I get Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/jhankins/public_html/mydirectory/results.php on line 17 I can telnet to the host and with the same username and password access the database tables etc. What gives? I'm using 4.0.6 of PHP and apache under Redhat Linux 7.2. Mysql is working fine from command line and remote via odbc? Also tryed mysql_connect with same problem.


« previous php.general (#89897) next »