
Jan 17th, 2008, 18:18
|
 |
Technical Administrator
|
|
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Re: how to delete tables with a prefix
This php should work, found it on a forum.
- PHP: Select all
<?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) == "php") { if (mysql_query("drop TABLE ".$tablename)) print "droped ".tablename."!<br />"; } } ?>
|