Correction status:qualified
Teacher's comments:
pdo 作业
<?php header("Content-Type: text/html; charset=UTF-8"); // 连接数据库 创建 pdo 对象 $pdo = new PDO('mysql:dbname=php','root','root'); // SQL 语句 处理 $sql = "DELETE FROM user WHERE `user_id`=:id"; //3.创建PDO预处理对象 $stmt = $pdo->prepare($sql); $data =['id'=>4]; $stmt->execute($data); echo '<h3>成功</h3>'; ?>
点击 "运行实例" 按钮查看在线实例