MySql - Create Table If Not Exists Else Truncate?

前端 未结 6 1636
隐瞒了意图╮
隐瞒了意图╮ 2020-12-31 00:23

Here is the updated question:

the current query is doing something like:

$sql1 = \"TRUNCATE TABLE fubar\";
$sql2 = \"CREATE TEMP         


        
6条回答
  •  别那么骄傲
    2020-12-31 00:36

    If you're using PHP, use mysql_list_tables to check that the table exists before TRUNCATE it.

提交回复
热议问题