简体   繁体   English

PHP连接sqlsrv_connect()?

[英]Php Connection sqlsrv_connect()?

In no way do not know why I did not solve the problem Despite so much to do my research did not reach a conclusion Perhaps there is a solution that can help you solve problems. 绝对不知道为什么我没有解决问题尽管做了很多事情,我的研究仍未得出结论。也许有一种解决方案可以帮助您解决问题。

My problem is: What's the reason I can not make the connection. 我的问题是:我无法建立连接是什么原因。

<?php

$server = "TOSHIBA";

$baglantiBilgi = array("Database"=>"test");
$baglan = sqlsrv_connect($server, $baglantiBilgi);

if($baglan){
    echo "Baglanti saglandi.<br />";
}else{
    echo "baglanti yok.<br />";
    die( '<pre>'.print_r( sqlsrv_errors(), true).'</pre>');
}
?>

//baglanti yok.
Array
(
    [0] => Array
        (
            [0] => IMSSP
            [SQLSTATE] => IMSSP
            [1] => -49
            [code] => -49
            [2] => 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] => 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] => Array
        (
            [0] => IM002
            [SQLSTATE] => IM002
            [1] => 0
            [code] => 0
            [2] => [Microsoft][ODBC Driver Manager] Veri kaynağı adı bulunamadı ve varsayılan sürücü belirtilmemiş
            [message] => [Microsoft][ODBC Driver Manager] Veri kaynağı adı bulunamadı ve varsayılan sürücü belirtilmemiş
        )
    )

What is the problem please help me in this regard. 有什么问题请在这方面帮助我。

As Jay Bhatt already commented, this is the answer: 正如Jay Bhatt所说,这就是答案:

Install Microsoft SQL Server 2012 Native Client . 安装Microsoft SQL Server 2012本机客户端

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM