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?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-04 09:19:082856browse

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>

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