Sovit Maharjan
Sovit Maharjan

Reputation: 175

Unable to connect to your database server using the provided settings sql-server 2008

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.php

Line 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
);

Upvotes: 1

Views: 260

Answers (2)

cks
cks

Reputation: 153

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

Upvotes: 1

Sovit Maharjan
Sovit Maharjan

Reputation: 175

I found the answer, what I need was the ODBC driver.

Upvotes: 0

Related Questions