I figured out the problem, apparently it has nothing to do with PHP or mySQL :-) hehe I had installed ZoneAlarm a while back on my workstation, and although it was deactivated it was the cause of this problem ( and many many other problems, so i'm glad that it's gone now).
Sorry for the trouble everyone, and thanks for the help. PS bolt : it's no bother :-) but no it's not me, sorry there aren't too many Firas' in the world though -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, March 29, 2002 5:51 PM To: [EMAIL PROTECTED] Subject: re:[PHP-WIN] mysql_connect() doesn't like "localhost" ?! Hello Firas, I think it could be an OS installation problem did you try simply pinging localhost? (from the command line) does it work replacing it with 127.0.0.1 in the mysql_connect? just some ideas.. PS sorry for bothering, I had a collegue working in Comitsiel named Firas, is it you? List: php-windows Subject: [PHP-WIN] mysql_connect() doesn't like "localhost" ?! From: "Firas Al-Ragom" <[EMAIL PROTECTED]> Date: 2002-03-29 13:57:49 [Download message RAW] Hi everyone, I've just installed Apache 1.3.24 and PHP 4.1.2 ( as a module ) and mySQL 3.23.49 on a Windows 2000 workstation. I didn't encounter any problems with the install, but for some strange reason whenever I use any scripts with mysql_connect("localhost", "user", "password") I get Warning: Can't connect to MySQL server on 'localhost' (10061) errors Now the strange thing is that if I remove the "localhost" and replace it with "" everything will work fine. I've tried downgrading mySQL and PHP to several different versions with the same results. This isn't the first time i've installed this kind of setup on a win2k machine, but it's the first time I've had this problem. Any help would be really appreciated. Sample script : <?php //list_db.php $link_id = mysql_connect("localhost", "user", "password"); $result = mysql_list_dbs($link_id); $num_rows = mysql_num_rows($result); while($db_data = mysql_fetch_row($result)) { echo $db_data[0]. "<BR>"; $result2 = mysql_list_tables($db_data[0]); $num_rows2 = mysql_num_rows($result2); while($table_data = mysql_fetch_row($result2)) echo "-- " . $table_data[0]. "<BR>"; echo "==> $num_rows2 table(s) in " . $db_data [0] . "<P>"; } ?> Resulting errors : Warning: Can't connect to MySQL server on 'localhost' (10061) in c:\webdev\www\index.php on line 4 Warning: MySQL Connection Failed: Can't connect to MySQL server on 'localhost' (10061) in c:\webdev\www\index.php on line 4 Warning: Supplied argument is not a valid MySQL-Link resource in c:\webdev\www\index.php on line 5 Warning: Supplied argument is not a valid MySQL result resource in c:\webdev\www\index.php on line 6 Warning: Supplied argument is not a valid MySQL result resource in c:\webdev\www\index.php on line 8 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php