php 环境需要安装 php_odbc 拓展 否则运行则会报错
$cnx = new \PDO("odbc:Driver={SQL Server};Server=youserver;Database=dbname;",'username','password');
var_dump($cnx);
$a = $cnx->query("SELECT * FROM tablename where condition");
var_dump($a);
foreach ($a as $b) {
var_dump($b);
}