Connection to sqlsrv
string not working.
$login = new PDO(\"sqlsrv:server=MYSQLSERVER\\SQLEXPRESS;Database=db_name\", \"user\", \"passw\");
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);
There's a problem with PHP Sql Server driver
You should update it to new version
As you mentioned you are using windows, this version is fully working on windows
https://github.com/Microsoft/msphpsql/releases/tag/v4.1.1-Windows
Try "ConnectionPooling=0" in DSN.
sometimes working and sometimes return error
It might be a problem on re-using connection.
DSN Reference: https://msdn.microsoft.com/en-us/library/ff628167(v=sql.105).aspx