<?php
$pdo=new PDO('mysql:host=localhost;dbname=student','root','root');
try{
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->beginTransaction();
//The first sql statement
$sqla="delete from chen where id=14";
$pdo->exec($sqla) ;
//The sql statement on the second day
$sqlb="delete froms chen where id=15"; //The from is written incorrectly on purpose
$pdo->exec($sqlb);
}catch(Exception $e){
$pdo ->rollBack();
$e->getMessage();
echo "Operation failed";
}
?>