Correction status:qualified
Teacher's comments:
<?php /** * 简化预处理更新数据 */ //1.连接数据库,创建pdo对象 $pdo = new PDO('mysql:dbname=php','root','root'); //2.创建预处理语句对象 $stmt = $pdo->prepare("DELETE FROM staff WHERE user_id=7"); //3.将参数绑定到预处理语句对象并执行 $stmt -> execute(['user_id'=>7]); echo '成功删除了'.$stmt->rowCount().'条记录';
点击 "运行实例" 按钮查看在线实例