Connecting to MSSQL 2005 with php PDO
===

I want to update my website code which runs under XAMPP 1.7.2 (http://www.apachefriends.org/en/news-article,146986.html) and which it's currently using the mssql_connect() to connect to the database.

I wanted to use php PDO to connect but I can't get it to work, I got stuck. First of all I downloaded the latest XAMPP package which comes with php 5.4.4, then I downloaded the PDO_SQLSRV driver (http://www.php.net/manual/en/ref.pdo-sqlsrv.php).

Now, I'm using this little code to try to connect:

    $host = 'NEW';
    $user = 'sa';
    $pass = 'mypass';
    $dbname = 'mydb';
    
    try {
    
      $DBH = new PDO("sqlsrv:Server=$host;Database=$dbname", $user, $pass);
    }
    catch(PDOException $e) {
        echo $e->getMessage();
    }

However I keep getting this message:

    SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712

I am using Windows server 2003 SP1 because the software I need to run it's stable with this OS only.

What options do I have to get this working ?

