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
Post a Comment