CodeIgniter Forums
How to Connect to 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: How to Connect to MsSQL (/showthread.php?tid=4018)



How to Connect to MsSQL - El Forum - 11-02-2007

[eluser]Obasi George[/eluser]
Good Day folks,

I have recently started to port some applications over to CI, but there seems to be a stumbling block at the moment.

Q: How do you connect to a MsSQL server that is not on the standard port?

I have already added the port to the database array (does not work), and don't want to use an ODBC connection.

Any ideas will be welcomed.


How to Connect to MsSQL - El Forum - 11-02-2007

[eluser]Pygon[/eluser]
You'll set it as part of the hostname (the mssql driver doesn't handle port as it should from the looks of it).

['hostname'] = "127.0.0.1:1234" for example, would connect to port "1234". ":port"


How to Connect to MsSQL - El Forum - 11-02-2007

[eluser]Obasi George[/eluser]
I tried that one first.

No dice. Then I checked the PHP configuration and it works just fine with ADOdb.

Will have to do something else I suppose.


How to Connect to MsSQL - El Forum - 11-02-2007

[eluser]Pygon[/eluser]
Silly question -- you set PHP up to use MsSQL right (client tools on windows/freetds on linux)? We had this problem when we migrated to mssql originally.


How to Connect to MsSQL - El Forum - 11-02-2007

[eluser]Obasi George[/eluser]
Most definitely a silly question, but one non the less.

Yes it has been setup, and works great with the ADOdb library.


How to Connect to MsSQL - El Forum - 11-02-2007

[eluser]Obasi George[/eluser]
I gave up and did the odbc connect, it works just fine.

Will work in the other connection over the weekend. Thanks much guys for your assistance.


How to Connect to MsSQL - El Forum - 11-02-2007

[eluser]llbbl[/eluser]
why use mssql? mysql is so much better!