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

ios - Is 'init' forbidden as *part* of a variable name? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -