Home > Backend Development > PHP Tutorial > How to clear a table in the database in PHP's TP framework?

How to clear a table in the database in PHP's TP framework?

WBOY
Release: 2016-08-04 09:19:08
Original
2828 people have browsed it

How to clear a table in the database in PHP's TP framework?

Am I wrong to write like this?

Reply content:

How to clear a table in the database in PHP's TP framework?

Am I wrong to write like this?

<code>$sql = 'TRUNCATE table conf_user';</code>
Copy after login

How to clear a table in the database in PHP's TP framework?

Correct answer, tested!

Two methods, give it a try

  • TRUNCAT watch

  • DELETE FROM table WHERE 1

<code>$sql = 'truncate table XXX';
M()->execute($sql);</code>
Copy after login
Related labels:
php
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