-2
我想連接到SQL服務器我的PHP版本是5.5,我有MS SQL Server 2008 R2和我使用PHP Codeigniger 2.2.6我使用sqlsrv32.exe我使用XAMPP如何連接SQL Server 2008與codeigniter 2.2.6
我想連接到SQL服務器我的PHP版本是5.5,我有MS SQL Server 2008 R2和我使用PHP Codeigniger 2.2.6我使用sqlsrv32.exe我使用XAMPP如何連接SQL Server 2008與codeigniter 2.2.6
在的application/config/database.php中是這樣定義的:
$db['dbname']['hostname'] = "ENJ01\SQLEXPRESS";
$db['dbname']['username'] = "user";
$db['dbname']['password'] = "password";
$db['dbname']['database'] = "dbname";
$db['dbname']['dbdriver'] = "sqlsrv";
$db['dbname']['dbprefix'] = "";
$db['dbname']['pconnect'] = TRUE;
$db['dbname']['db_debug'] = TRUE;
$db['dbname']['cache_on'] = FALSE;
$db['dbname']['cachedir'] = "";
$db['dbname']['char_set'] = "utf8";
$db['dbname']['dbcollat'] = "utf8_general_ci";
$db['dbname']['swap_pre'] = '';
$db['dbname']['autoinit'] = TRUE;
$db['dbname']['stricton'] = FALSE;
然後進入系統/數據庫/驅動器/ SQLSRV/sqlsrv_driver.php
function db_pconnect()
{
//$this->db_connect(TRUE);
return $this->db_connect(TRUE);
}
和
function affected_rows()
{
//return @sqlrv_rows_affected($this->conn_id);
return @sqlsrv_num_rows($this->result_id);
}
有錯誤。致命錯誤:調用未定義的函數sqlsrv_connect()在C:\ xampp \ htdocs \ api \ system \ database \ drivers \ sqlsrv \ sqlsrv_driver.php上線77 –
請閱讀此頁https://stackoverflow.com/questions/22015179 /致命錯誤呼叫到未定義功能 - SQLSRV-連接。服務器中存在一些擴展問題 –
之後存在另一個錯誤 發生數據庫錯誤 無法使用提供的設置連接到數據庫服務器。 文件名:C:\ xampp \ htdocs \ api \ system \ database \ DB_driver.php 行號:125 –