{SOLVED} How to access Sql Server using Apache on a windows machine?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • martinroldan
    New Member
    • Nov 2006
    • 4

    {SOLVED} How to access Sql Server using Apache on a windows machine?

    Hello all, first I want to say that I have been developing in PHP using MySql, but now I want to do it using Sql Server, so I have downloaded and installed Sql Server Express 2005.
    I have read a lot about how should make a connection, but still I cannot make it work. I am using PHP 5.0.4 and Apache 1.3.3 on windows XP SP2.
    This is what I have tried to do:
    [PHP]
    $myServer = "localhost,1031 ";
    $myUser = "sa";
    $myPass = "e********" ;
    $myDB = "Northwind" ;
    $s = @mssql_connect( $myServer, $myUser, $myPass)
    or die("Unable to connect to SQL Server on $myServer");
    [/PHP]
    but it does not work, I always get the message about being Unable to connect to SQL Server on localhost,1031
    The 1031 is the port that I have specified, I have made telnet localhost 1031 and it seems to work, but why is not my script working?
    Thanks for any help

    Martin
  • martinroldan
    New Member
    • Nov 2006
    • 4

    #2
    Hello, I want to reply myself to let you all know how I solved what was happening. I had to download the latest version of ntwdblib.dll, the version that comes with PHP is not the last one, and it does not work properly.

    Martin

    Comment

    Working...