mysql_connect("localhost", "", "" ) or die(mysql_error());
echo "Connected to MySQL<br />";
?>
gives this warning:
"Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\Program Files (x86)\EasyPHP-5.3.2i\www\NewProject\filename.php on line 3"
Can somebody please tell me what I am doing wrong? I have tried many variations of the fields and they all fail to connect, and I can't seem to figure out what I'm doing incorrectly.
I am trying hard to link mysql to database in php to no avail. I am getting this message, could anyone please help in fixing this matter? Thanks anyway:
Notice: Undefined variable: slect in C:\Program Files (x86)\EasyPHP-5.3.2i\www\TestQuery.php on line 13
Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\Program Files (x86)\EasyPHP-5.3.2i\www\TestQuery.php on line 15
Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Program Files (x86)\EasyPHP-5.3.2i\www\TestQuery.php on line 15
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files (x86)\EasyPHP-5.3.2i\www\TestQuery.php on line 15
Worked like a charm for me in Windows 7 Pro 64 bits!
If you don't wanna change 'localhost' to '127.0.0.1' in all your files, you can edit the 'hosts' file located at 'C:\Windows\System32\drivers\etc' in Windows, just uncomment the line that says "# 127.0.0.1 localhost".