I'm trying to configure my QNAP TS-231P Web server to connect to a MS SQL database installed on a Windows server (MSSQL Express 2014).
In QNAP Control Panel -> Server Web, I added in the php.ini file this line
extension = mssql.so
and now running phpinfo() I see the mssql section (Library version is FreeTDS).
My web application, built on CodeIgniter 3.1.9, is unable to connect to MSSQL (it works on XAMPP ver 3.2.2 installed on Windows), I also tried this simple php code:
<?php
$connection = mssql_connect('10.10.10.100\SQLEXPRESS', 'sa', 'mypassword');
if (!$connection) {
die('Unable to connect!');
}
if (!mssql_select_db('MY_DATABASE', $connection)) {
die('Unable to select database!');
}
$result = mssql_query('SELECT * FROM MY_TABLE');
while ($row = mssql_fetch_array($result)) {
var_dump($row);
}
mssql_free_result($result);
?>
but the connection fails. The question is what can I do for getting a successful connection ?