How to connect to sql server express with PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dsatino
    Contributor
    • May 2010
    • 393

    How to connect to sql server express with PHP

    I'm new to PHP, but probably expert with databases. I'm very familiar with connection strings, objects, ODBC, etc.

    For some reason I can't seem to accomplish this simple task in PHP. My guess is that it's something easy, but it eludes me. My 'site' is hosted on my PC, which is probably the problem since network config is not a strong suit for me.

    In any case, here's what I have:
    MS Surface running windows 8.1
    Computer Name: HAL
    IIS is running
    PHP interpreter is installed and running
    SQL Server is running (I've tested the connection)

    I've created my 'site' using Microsoft WebMatrix, which I installed today.

    The file location of the site is:
    C:\Users\fName\ Documents\My Web Sites\lName.fNa me

    The web.config file for the db looks like this:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <connectionStrings>
            <add connectionString="server=.\SQLEXPRESS;uid=DAS_TestData1U;pwd=c0{#nPA*(!Fy;Database=DAS_TestData1" name="DAS_TestData1" providerName="System.Data.SqlClient" />
        </connectionStrings>
    </configuration>

    The connection string used by WebMatrix is: server=.\SQLEXP RESS;uid=DAS_Te stData1U;pwd=** ****;database=D AS_TestData1



    Any help would be appreciated. Thanks
Working...