PHP & MySQL: Truncate multiple tables

前端 未结 3 1498
醉梦人生
醉梦人生 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:55

    You have a couple different option.

    • Run a query for each truncate
    • Create a stored procedure that will truncate all the tables you want to do.

提交回复
热议问题