[PDO]①①--预处理语句中的占位符

prepare($sql);
    $stmt->execute(array(":username" => $username, ":password" => $password));
    echo $stmt->rowCount();

//    $sql = "select * from user where username='king2' and password='king2'";
//    $stmt = $pdo->prepare($sql);
//    $stmt->execute(array($username, $password));
//    echo $stmt->rowCount();


} catch (PDOException $e) {
    echo $e->getMessage();
}

?>
Paste_Image.png

你可能感兴趣的:([PDO]①①--预处理语句中的占位符)