Click to See Complete Forum and Search --> : mysql, how to delete some table


b1122
09-15-2006, 07:49 PM
Hi all,
is that possible in mysql (using php), delete all table that have similiar name.
example, i want delete table that have name tab01, tab02, tab03.
just try 'delete from tab**' but is not working.
thanks for any reply

chazzy
09-16-2006, 10:57 AM
DROP TABLE `table_name`; is the proper SQL.

b1122
09-17-2006, 07:48 PM
I mean with 1 script, delete many table with similiar names.
example, table name begining with abcxxx (abc001, abc002, abc003, ...)

chazzy
09-17-2006, 07:56 PM
well..how are you expecting to read in the table names. there is no wild card for something like dropping a table. you can read the table names from a data dictionary (usually in the mysql database under tables, i believe).