Home » Php » sql server – Codeigniter 3 php 7.3 mssql database (sqlsrv) error

sql server – Codeigniter 3 php 7.3 mssql database (sqlsrv) error

Posted by: admin February 25, 2020 Leave a comment


I need connecting Mssql database via Codeigniter3 my PHP version is 7.3 but when I run the page I got this

A Database Error Occurred
SQLSTATE[IMSSP]: An unsupported attribute was designated on the PDO object.

Filename: C:/xampp/htdocs/system/database/drivers/pdo/pdo_driver.php

Line Number: 142

My application/config/database.php file like this

$db['default'] = array(
'dsn'   => 'sqlsrv:Server=,1433;Database=DATABASENAME',
'hostname' => '',
'username' => 'sa',
'password' => '*****',
'database' => 'DATABASENAME',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => TRUE,
'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

in my php.ini file, I have


For the solution what I tried

1 – I considered the problem caused by driver dlls. there was the php_pdo_sqlsrv_73.ts.dll but there was not php_pdo_sqlsrv_73.dll (but without this dll I could work without Codeigniter my php files) have tried to find php_pdo_sqlsrv_73.dll on internet to download but I could not find it.

2 – I have commented out …/database.php s hostname or database rows

is there a 3. or etc. solution?

How to&Answers:

I have commented out

//'db_debug' => TRUE,

it solved