CodeIgniter Forums
PDO with MSSQL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: PDO with MSSQL (/showthread.php?tid=52133)



PDO with MSSQL - El Forum - 05-30-2012

[eluser]ci_user[/eluser]
In case you need to use PDO with MSSQL you will need to hack the pdo_driver:

Code:
this->hostname .= ";dbname=".$this->database;

Needs to be:

Code:
if (strstr($this->hostname, 'sqlsrv') == TRUE){
   $this->hostname;
} else {
   $this->hostname .= ";dbname=".$this->database;
}

Hope this saves someone a headache!