Truncate table php code?

It’s quite easy, here is the code.

1
2
3
<?php
mysqli_query($connection, "TRUNCATE table_name");
?>

You will also need to declare the $connection variable but I guess that is pretty easy.

So this is how you TRUNCATE a table (empty it). It will remove all the entries but it will preserve the structure.

Coding

ADD A COMMENT: