Codeigniter Mssql Connection

Connect CodeIgniter 3 with SQL server

We've a project with MSSQL Server (Navision as an ERP behind of that) and CI.
We had huge troubles with the official (sick!) driver from Microsoft and had problems with the 64 bit environment too;

After long research we found an unofficial release - read the posts of the following links. It worked like a charm for us:

How to install Microsoft's SQL Server Driver for PHP

Unofficial Microsoft SQL Server Driver for PHP (sqlsrv)

How to connect mssql in Codeigniter?

You are running an unsupported version of PHP. You need to upgrade your PHP version to continue to receive security updates. See https://php.net/supported-versions.php.

Doing this would also give you access to newer versions of the sqlsrv drivers. This is important because your current driver cannot connect to newer versions of SQL Server.

You've stated you're using SQL 2017. However as per the Microsoft PHP Drivers for SQL Server Support Matrix, with PHP version 5.6 you can only run version 3.2 of the sqlsrv drivers, and version 3.2 of the drivers only supports SQL 2014 and below.

Connect codeigniter database with SQL server on different server?

Make sure your server which has the database should support remote DB connection. You've to configure the remote db connection to use your db outside your server.

Say, if you are using linux based server and mysql as db, you can follow this doc:

https://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

Codeigniter: How to setup connection to a SQL server (2008)

I've had the same trouble you've had about a year ago. Have a look at the replies here, there are some great suggestions from people in there: CodeIgniter MSSQL connection

Also, a thread was posted a few days ago here: CI connect to SQL SERVER - check out my answer over there as well, since it's solved the problem for that particular developer.



Related Topics



Leave a reply



Submit