So I have Microsoft SQL Server 2008 R2 installed and an instance set up with a database an user setup on that database with a password. I have installed PHP, and IIS and got PH working from the WWWROOT folder, but when tryng to connect to my database it is not just not working. I have spent two days straight on this, and pulling my hair out. I was able to connect to the database using ColdFusion and its web server, PHP was meant to be easier! Here is the code i am using to connect to my database:
<?php
mysql_connect("MYINSTANCE", "MYUSER", "MYPASSWORD") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
?>
Obviously I have omitted my server, user and password from the above code. I have installed the drivers from MS and installed into the PHP EXT folder, still no luck, I will appreciate any help from you guys!
Thanks!!