I have installed Xampp and Codeigniter. Now I want to connect to a SQL database. I have installed the sqlsrv drivers on Xampp, so that works. I also fixed a bug in the sqlsrv_driver.php and changed this:
function db_pconnect()
{
// $this->db_connect(TRUE); original
return $this->db_connect(TRUE);
}
This is my config file:
$db['default']['hostname'] = 'ipAddress\instanceName';
$db['default']['username'] = 'xxx';
$db['default']['password'] = 'xxx';
$db['default']['database'] = 'xxx';
$db['default']['dbdriver'] = 'sqlsrv';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
I have the following error:
Unable to connect to your database server using the provided settings.
Filename: C:\xampp\htdocs\system\database\DB_driver.php
Line Number: 124
I had some errors with sqlsrv before, but I solved it by the answers on this question: