Unable to connect to SQL Server with PHP -


connection sqlsrv string not working.

$login = new pdo("sqlsrv:server=mysqlserver\sqlexpress;database=db_name", "user", "passw"); 

and have error message: fatal error: invalid handle returned.

i'm 101% sure login details ok. because works on other projects. problem php 7?

looks connect ms-sql, need 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); 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -