title: connect to a mapped SQL server through PHP
body: <p>I am working with an already built database on 2008 Server R2 platform, and am wanting to create an application to query said DB.</p>
  
  <p>All of my experience is with local installs of MySQL, however this database is an MS SQL server 10.50.</p>
  
  <p>My question is this, 
  The SQL server is a mapped drive to the web server, I've got all proper PHP drivers and SQLsrv extensions installed and am getting proper phpinfo read outs, everything is functioning properly, but I am stumped as to how to connect to the SQL server. To clarify,</p>
  
  <p>My application lives on the web server, I am wanting to connect via php to the SQL server which is mapped to the web server. I'm using windows authentication.  </p>
  
  <p>The connection PHP i have written so far looks like this</p>
  
  <pre><code>&lt;?php
  $serverName = "SmartCM.IMG"; 
  
  
  $connectionInfo = array( "Database"=&gt;"SMARTCM");
  $conn = sqlsrv_connect( $serverName, $connectionInfo);
  
  if( $conn ) {
       echo "Connection established.&lt;br /&gt;";
  }else{
       echo "I tried, but it didn't work out... sorry.&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;";
       die( print_r( sqlsrv_errors(), true));
  }
  ?&gt;
  </code></pre>
  
  <p>This is the error read out I get</p>
  
  <pre><code>Array ( 
      [0] =&gt; Array ( 
          [0] =&gt; 08001 
          [SQLSTATE] =&gt; 08001 
          [1] =&gt; 53 
          [code] =&gt; 53 
          [2] =&gt; [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. 
          [message] =&gt; [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. ) 
      [1] =&gt; Array ( 
          [0] =&gt; HYT00 
          [SQLSTATE] =&gt; HYT00 
          [1] =&gt; 0 
          [code] =&gt; 0 
          [2] =&gt; [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired 
          [message] =&gt; [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired ) 
      [2] =&gt; Array ( 
          [0] =&gt; 08001 
          [SQLSTATE] =&gt; 08001 
          [1] =&gt; 53 
          [code] =&gt; 53 
          [2] =&gt; [Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. 
          [message] =&gt; [Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) 
      )
  </code></pre>