I can’t connect to database. i have these extension php_pdo_sqlsrv_72_ts_x64.dll
, php_sqlsrv_72_ts_x64
and added “extension = php_sqlsrv_72….” line in php.ini
file. What am i doing wrong?
Unable to connect to your database server using the provided settings.
Filename:
C:/Apache24/htdocs/smartattendanceciwec/system/database/DB_driver.phpLine Number: 436
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'sa',
'password' => 'password',
'database' => 'Hospital',
'dbdriver' => 'sqlsrv',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
2
Answers
I found the answer, what I need was the ODBC driver.
what you are missing is odbc driver in your system.
beacuse you are using server 2008 R2 you will need to install odbc driver 11
you can download it from here: https://www.microsoft.com/en-us/download/details.aspx?id=36434