03-02-2008, 10:28 PM
|
#7 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Posts: 154
Thanks: 31
|
Quote:
Originally Posted by obolus
Is there a way to empty a DB...
|
Quote:
Originally Posted by obolus
I don't want to empty all of the existing tables, I want to get rid of every existing table in the database.
|
Most of the time when forum posts request info on "how to do this with a database", they're referring to the table, not the actual database. I naturally assumed you wanted to empty the table, not DROP all tables from the database.
You can use the command line tool 'mysqladmin' to drop all tables in a comma delimited list, I believe. If you could create a system exec() statement that called this function with those parameters it might be easier to do that several calls to mysql_query() to drop the table(s) (depending on how many you have).
The other way to look at it, if you have the privilege to do so, just make one call to
Code:
DROP DATABASE databasename;
__________________
I reject your reality, and substitute my own.
|
|
|
|