No, the @ was in the right place (if memory serves me the book said this suppresses the error output.) The problem was my sock file was not in the default location so I had to specify it. If you check the thread the answer is there on how to find where your sock is located.
Best Regards, Jim Hankins "Gerard Samuel" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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. > > > > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php