title: MySQL connections from PHP on IIS?
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>2 - I am running IIS 7.5 with PHP enabled</p>
  
  <p>3 - I have tried to connect to two completely separate MySQL instances (different hosts, different DBs, etc) and it will not connect</p>
  
  <p>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?)</p>
  
  <p>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?</p>
  
  <p>The PHP code is as follow - nothing special I think:</p>
  
  <pre><code>$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");
  </code></pre>
  
  <p>the above code always results in the die statement of "Could not connect to database"</p>