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

PHP PDO database class delete operation

WBOY
WBOYOriginal
2016-07-25 08:54:291294browse
  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


Statement:
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