title: PHP PDO & SQL Server connection with dblib issues
body: <p>I have experience about PDO but I was working with MySQL so far. I needed to work with PDO + SQL Server but seems something weird going on.</p>
  
  <pre><code>&lt;?php
  $dsn = 'dblib:dbname=my_db;host=127.0.0.1'; //dbname and host is on different server, not localhost
  $user = 'username';
  $password = 'password';
  try {
      $db = new PDO($dsn, $user, $password);
      $db-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );  
  }
  catch(PDOException $e) {  
      echo $e-&gt;getMessage();  
  } 
  ?&gt;
  </code></pre>
  
  <p>I'm getting following error;</p>
  
  <blockquote>
    <p>SQLSTATE[HY000] General SQL Server error: Check messages from the SQL Server. (severity 5) </p>
  </blockquote>
  
  <p>I'm really confused right now what is wrong with my code. Dblib is installed on the server, I didn't even make any queries and this code should work just fine. Where ever I checked over the internet every time it is the same code. That's why I'm sure that there is nothing wrong with my code.</p>
  
  <p>I will be glad if anyone who has experience about it could help me out with it.</p>
  
  <p>P.S. I'm aware of the fact that dblib is in experimental state still it should be able to establish a connection.</p>
  
  <p>Thank you for your help and time in advance.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Problem is partially solved. Thanks to <a href="http://www.ut.com.tr/" rel="nofollow"><strong>Uzay Teknoloji A.Ş.</strong></a> they've created SQL Server 2008 R2 database for me to test establishing SQL Server connection. The database I was trying to connect before was SQL Server 2000. It seems SQL Server 2000 doesn't support dblib.</p>