How do I clear all the entries from just one table in MySQL with PHP?
The simplest way to do it, if you have the privileges, is:
DROP DATABASE dbName; CREATE DATABASE dbName; USE DATABASE dbName;
The alternative is to query the
information_schema database for triggers, stored routines (procedures and functions), tables, views and possibly something else, and drop them individually.
Even after this, your database might still not be in the same state as a newly created one, since it might have a custom default character set and collation set. Use
ALTER DATABASE to change that.
As features keep getting added (events...) you'll have more and more work this way. So really, the only way to completely empty the database is to drop it and re-create it.