Forum Moderators: coopster
Anyhow, after doing some digging over at mysql.com, I found this page:
13.2.8 DROP TABLE Syntax [mysql.com]
The user comments imply that there is no wildcard or LIKE(regex) type syntax allowed on that command. Well, that bites but, you can easily run a quick PHP script to do it.
Something like this:
<?php
//assuming you're connected and have selected the db already
$result = mysql_query("SHOW TABLES");
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
$tablename = mysql_result($result, $i, 0);
if (substr($tablename, 0, 3) == "vb3")
{
if (mysql_query("DROP TABLE ".$tablename)) print "DROPed ".tablename."!<br />";
}
}
?>
I tested this myself with an old table I didn't want but please back up your database before running it.