Connection to sqlsrv
string not working.
$login = new PDO("sqlsrv:server=MYSQLSERVER\SQLEXPRESS;Database=db_name", "user", "passw");
And i have error message:
Fatal error: Invalid handle returned
.
I'm 101% sure that login details is OK. Because it works on other projects. Could be a problem PHP 7
?
Looks like to connect to MS-SQL, you will need to utilize ODBC.
Reference:http://php.net/manual/en/pdo.construct.php#120705
$odbc="odbc:Driver={SQL Server};Server=$server;Database=$database;";
$cnx = new PDO( $odbc , $user, $password);