CodeIgniter Forums
CI and MS SQL how to connect ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: CI and MS SQL how to connect ? (/thread-25517.html)



CI and MS SQL how to connect ? - El Forum - 12-15-2009

[eluser]umefarooq[/eluser]
Hi
Has anybody used CI with sql server please share you experience how to connect with MS sql all version what the parameter for database.php file to connect MS sql.


CI and MS SQL how to connect ? - El Forum - 12-15-2009

[eluser]timpisti[/eluser]
Hi (sorry for bad english).

MS-SQL (MS) and PHP (Mostly Linux) using in same time is always a difficult thing.

First: Over 4-6 month of searching, I can't find a working solution to connect the MSSQL database with Windows autentication on PHP. There is some setting in php.ini at MSSQL part, but it's not seems to be working. It's not the CI problem, the mssql.connect function throw an error.

Second: You may create an SQL user for PHP to connect a database. Bad point: You'll miss the windows authentication. Good: Commonly used for everywhere, with a very little security risk.

Third: You may use ODBC connection. The CI work properly with that.

Good luck.


CI and MS SQL how to connect ? - El Forum - 12-15-2009

[eluser]umefarooq[/eluser]
ok that's great but can you share how to use ODBC connection parameter for CI


CI and MS SQL how to connect ? - El Forum - 12-16-2009

[eluser]timpisti[/eluser]
Well, I pick the solution with discreet SQL user. You may find a lot of docs about ODBC and CI. My advice is check the created ODBC connection with other program than PHP, to check the correct and working setup.