views:

361

answers:

2

I currently have a school assignment that involves both PHP and asp.net. Now the assignment is that I make an E-commerce website with PHP and it's CMS with asp.net. Therefore both websites connect to the same database which is in SQL Server.

At the moment using Visual Studio's SQL Server Express, and I have generated an mdf file as the database. I am using xampplite as a web-server and notepad++ to code PHP and I am trying to connect to the mdf file.

Is it possible? If so, What should I use as a connection string?

+2  A: 

Here in the manual it's all explained. Look at the user comments as well.

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

Vinko Vrsalovic
+1  A: 

You will need to connect to a running SQL server instance which has the mdf file attached, rather than "connecting to the mdf file". As Vinko said, it is covered in the PHP manual for the mssql_ functions. You will probably need to first create a username/password in SQL Server which you can use to connect.

Tom Haigh