Answer the question
In order to leave comments, you need to log in
How to connect to MSSQL from PHP7.0?
Configured PHP according to this https://stackoverflow.com/questions/34377338/linux... instructions (I only had to add .so to the file names in the config).
Wrote a simple code
$serverName = "192.168.1.1\INSTANCENAME";
$connectionInfo = array("Database"=>"DBNAME", "UID"=>"user", "PWD"=>"password");
$conn = sqlsrv_connect($serverName, $connectionInfo);
$sql = "select * from table";
$stmt = sqlsrv_query($conn, $sql);
print_r($stmt);
sqlsrv_close($conn);
sqlcmd -S 192.168.1.1 -d DBNAME -U user -P password -Q "select * from table"
executed from the same machine where nginx+php is installed gives the desired result. $serverName = "192.168.1.1";
Answer the question
In order to leave comments, you need to log in
$link = mssql_connect('ip', 'user', 'pass');
mssql_select_db('bd, $link);
mb_internal_encoding('utf8');
Doesn't work in branch 7?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question