PHP连接sqlsrv_connect()?

时间:2014-05-09 12:36:46

标签: php sql sql-server

绝不知道为什么我没有解决问题 尽管如此,我的研究还没有得出结论 也许有一个解决方案可以帮助您解决问题。

我的问题是:我无法建立连接的原因是什么。

<?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ş
        )
    )

有什么问题请在这方面帮助我。

1 个答案:

答案 0 :(得分:0)

正如Jay Bhatt已经评论过的,这就是答案:

安装Microsoft SQL Server 2012 Native Client

相关问题