I have inherited a web site that is in PHP and we are mostly a Windows shop. I cannot get the PHP code to connect to MySQL at all.
1 - The IDE is Eclipse. I imported the project and set up a debug configuration and everything works fine there with HTML and other PHP (non DB) code.
2 - I am running IIS 7.5 with PHP enabled
3 - I have tried to connect to two completely separate MySQL instances (different hosts, different DBs, etc) and it will not connect
I have already made sure that sql.safemode is turned to OFF and there is no default server in php.ini (that shouldn't come into play if safe mode is OFF, right?)
I have done nothing special to the PHP code or project and I'm wondering if that's part of the issue - do I need a JAR or reference of any kind to enable the MySQL connections?
The PHP code is as follow - nothing special I think:
$db_name = "foo";
$connection = @mysql_connect("myserver", "myuser", "mypw") or die("Could not connect to database");
mysql_select_db($db_name, $connection) or die("Count not select database");
the above code always results in the die statement of "Could not connect to database"