封包如下:
Uncaught Error: Call to undefined function sqlsrv_connect()
PHP 使用的是PHP工具箱
版本是PHP 7.2.10
SQLserver 2008R2
Apache
測試程式碼如下:
< ;?php
$servern = '192.168.60.21';
$coninfo = array("Database"=>"byjzyy","UID"=>"sa","PWD"=>" W_123");
$conn=sqlsrv_connect($servern,$coninfo) or die("連結失敗!!請重試!");
$val=sqlsrv_query($conn,"select top 10 * from from goodsdoc");
while($row=sqlsrv_fetch_array($val)){
echo $row."<br>";
}
sqlite_close($conn);
我網友提示:在https://www.microsoft.com/en-us/download/ details.aspx?id=20098 下載了 Microsoft Drivers for PHP for SQL Server
將:
php_pdo_sqlsrv_7_ts_x86.
將:
php_pdo_sqlsrv_7_ts_x86. dll 和 phpsqlsrv_7_ts_x86.dll 7.7. \ext
並在php.ini
extension=php_sqlsrv_72_ts_x86.dll
extension=php_pdo_sqlsrv_72_ts_x86.dll
### 還是會報錯 求指點是什麼問題###