目录

delete 删除

优质
小牛编辑
148浏览
2023-12-01

delete

删除表中的数据

delete($table, $where)
  • table [string]

    表名.

  • where [array]

    WHERE 删除条件.

Return: [PDOStatement]返回 PDOStatement对象一个比较危险的操作,操作前请考虑好。。。
$database->delete("account", [	"AND" => [		"type" => "business",		"age[ 18	]]);// The return object of delete() is PDOStatement, so you can use its methods to get more information.$data = $database->delete("account", [	"AND" => [		"type" => "business",		"age[ 18	]]);// Returns the number of rows affected by the last SQL statementecho $data->rowCount();// Read more: http://php.net/manual/en/class.pdostatement.php