Note that there are some explanatory texts on larger screens.

plurals
  1. POConnecting PHP and SQL Server using WAMP
    primarykey
    data
    text
    <p>I am trying to connect my PHP with SQL Server. I have to go to the field to test it, so I was configuring a laptop with the necessary settings. In the desktop I currently work at, the connection works properly. But in the laptop, it won't connect. Here is the code I am using:</p> <pre><code>$serverName = "server"; //serverName\instanceName $connectionInfo = array( "Database"=&gt;"DB", "UID"=&gt;"user", "PWD"=&gt;"pass"); $conn = sqlsrv_connect($serverName, $connectionInfo); if( $conn ) { echo "Connection established.&lt;br /&gt;"; }else{ echo "Connection could not be established.&lt;br /&gt;"; die( print_r( sqlsrv_errors(), true)); } </code></pre> <p>I have placed the .dlls in the ext file and I have written the extension in the php.ini but somehow it still won't work. This is the error I am getting:</p> <pre><code>Connection could not be established. Array ( [0] =&gt; Array ( [0] =&gt; IMSSP [SQLSTATE] =&gt; IMSSP [1] =&gt; -49 [code] =&gt; -49 [2] =&gt; This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] =&gt; This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] =&gt; Array ( [0] =&gt; IM002 [SQLSTATE] =&gt; IM002 [1] =&gt; 0 [code] =&gt; 0 [2] =&gt; [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] =&gt; [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) ) </code></pre> <p>Any help will be appreciated. Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload