Using MSSQL On PHP7
Recently, one of my clients needs pull data from one of his new provider, unexpectedly, this new provider use MSSQL, however, we upgraded from php5.6 to php7, the old mssql_connect
function is being removed at php7, read more here, we need another solution for it.
Sybase
The solution is using PDO to handle connection, but before it, we need install Sybase dependency. Below is working perfectly fine with Ubuntu 14.04.
PDO
After it installed correctly, you can use the code below to connect with MSSQL
PHP5 + Sybase
Here is the code will works for php5, you need install sudo apt-get install php5-sybase
, you could use the example below to handle the query. Read more here
|
|