PHP & MySQL: Truncate multiple tables

前端 未结 3 1497
醉梦人生
醉梦人生 2020-12-20 02:02

I tried to truncate a table but why is it not working? must something wrong in the database query?

$sql = \"TRUNCATE TABLE `table_name`\";

$result = $connec         


        
3条回答
  •  半阙折子戏
    2020-12-20 02:42

    By the MySQL Reference Manual

    http://dev.mysql.com/doc/refman/5.0/en/truncate-table.html

    You can only delete one table at a time using TRUNCATE.

    You could try executing multiple queries in one PHP query by using a ";" delimiter between them.

提交回复
热议问题