Home > Backend Development > PHP Tutorial > PHP PDO database class delete operation

PHP PDO database class delete operation

WBOY
Release: 2016-07-25 08:54:29
Original
1351 people have browsed it
  1. //Data deletion

  2. $sql = "DELETE FROM `test` WHERE `id` > :id";
  3. $stmt = $pdo->prepare($sql);
  4. $stmt->execute(array(':id' => 7));

  5. echo $stmt->rowCount();

Copy Code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template