Connecting to mdf file in SQL Server via PHP

I currently have a school assignment that includes both PHP and asp.net. Now the assignment is that I am making an e-commerce site with PHP and the CMS with asp.net. Therefore, both websites connect to the same database that resides in SQL Server.

Currently using Visual Studio SQL Server Express and I have created an mdf file as a database. I am using xampplite as a web server and notepad ++ for PHP code and I am trying to connect to an mdf file.

Is it possible? If so, what should I use as the connection string?

+1


source to share


2 answers


Here in the manual everything is explained. Look also at user comments.



http://www.php.net/manual/en/function.mssql-connect.php

+3


source


You will need to connect to the executable instance of the SQL server that has the mdf file attached, not "connect to mdf file". As Vinko said, this is described in the PHP manual for mssql_ functions. You probably first need to create a username / password in SQL Server that you can use to connect.



+1


source







All Articles