$server = "myPC\SQLEXPRESS"; $database = 'User'; $user = 'sa'; $password = '1234'; //透過ODBC連線到MS-SQL $conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $password); //透過Microsoft SQL Server Functions (PDO_SQLSRV)連線到MS-SQL try { $dbh = new PDO("sqlsrv:Server=$server;Database=$database", $user, $password); } catch (PDOException $e) { echo "Failed to get DB handle: " . $e->getMessage() . "\n"; exit; }
-
近期文章
分類
其它
彙整
近期迴響