#05 データの更新・削除

 
データの更新
 
$stmt = $dbh->prepare("update users set email = :email where name like :name");
$stmt->execute(array(":email"=>"dummy", ":name"=>"n%"));
 
データの削除
 
$stmt = $dbh->prepare("delete from users where password = :password");
$stmt->execute(array(":password"=>"p10"));
 
rowCount( )
 
echo $stmt->rowCount() . " records deleted";

PAGE TOP

< 前へ 目次に戻る 次へ >