Blogger Information
Blog 32
fans 0
comment 0
visits 19598
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0425 pdo删除 操作
XuanGG的博客
Original
590 people have browsed it

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>';


?>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!