CodeIgniter Forums
Codeigniter 3 and sqlsrv - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Codeigniter 3 and sqlsrv (/showthread.php?tid=61650)



Codeigniter 3 and sqlsrv - monomicho - 05-04-2015

How can i connect sql server 2008 and code?
i use sqlsrv dll in my php5.4
How can i config my config>database?


RE: Codeigniter 3 and sqlsrv - sintakonte - 05-06-2015

SQLSrv Driver Installation could be tricky sometimes but

if you've configured your server environment correctly this should help you:

PHP Code:
$db['mssql'] = array(
    
'dsn'    => 'sqlsrv:server=192.168.0.1,1433;Database=xxx',
    
'hostname' => '',
    
'username' => 'xxx',
    
'password' => 'xxx',
    
'database' => '',
    
'dbdriver' => 'pdo',
    
'dbprefix' => '',
    
'pconnect' => FALSE,
    
'db_debug' => TRUE,
    
'cache_on' => FALSE,
    
'cachedir' => '',
    
'char_set' => 'utf8',
    
'dbcollat' => 'utf8_general_ci',
    
'swap_pre' => '',
    
'autoinit' => TRUE,
    
'encrypt' => FALSE,
    
'compress' => FALSE,
    
'stricton' => FALSE,
    
'failover' => array(),
    
'save_queries' => TRUE
); 

if you've troubles to install sqlsrv 3.1 or higher you might take a look at this Resource