下面有一个示例代码连接到mysql
<?php
$dbh = new PDO('mysql:host=localhost;dbname=register', 'root', '12345');
$stmt = $dbh->prepare("insert into registered(name, email, password) values (?,?,?)");
$stmt->bindParam(1, $name);
$stmt->bindParam(2, $email);
$stmt->bindParam(3, $pwd);
$name = $_POST["fname"];
$email = $_POST["email"];
$pwd = $_POST["pwd"];
$stmt->execute();
echo "<p>Thank you for registering!</p>";
?>
但我需要一个类似于上面的代码来连接&#34; mssql &#34;使用 mssql()函数的数据库参考http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL 在上面的链接中,他们连接到没有pdo的mysql