<?php
$pdo=new PDO('mysql:host=localhost;dbname=test','root','');
$pdo->exec('set names utf8');
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
try{
$pdo->beginTransaction();
$sql="delete from user where id=10";
$smt=$pdo->prepare($sql);
$smt->execute();
$sql="delete fom user where id=8";
$smt=$pdo->prepare($sql);
$smt->execute();
$pdo->commit();
}catch(PDOException $e){
echo $e->getMessage();
$pdo->rollBack();
}
吃鸡游戏