<html><body>
<?php
$db_con = mysql_connect("localhost", "root", "password");
$DB = 'The DB you want to empty';
/*****Don't edit after here*****/
mysql_select_db($DB);
$tables = mysql_list_tables($DB);
while (list($bla)=mysql_fetch_array($tables))
{
echo "Dropping table $bla...";
if(!mysql_query("DROP TABLE $bla"))
{echo "ERROR<br>\n";}else{echo "OK<br>\n";}
}
?>
</body></html>
hehe thanks for the script, the first time it only deleted a few and the rest errors but did it again and did the whole thing...Originally posted by gyrbo
I made a script, here's the code:
With an easy if statement, you can even use it to only delete table with a special name (eg, all that start with 'nuke_')PHP:<html><body> <?php $db_con = mysql_connect("localhost", "root", "password"); $DB = 'The DB you want to empty'; /*****Don't edit after here*****/ mysql_select_db($DB); $tables = mysql_list_tables($DB); while (list($bla)=mysql_fetch_array($tables)) { echo "Dropping table $bla..."; if(!mysql_query("DROP TABLE $bla")) {echo "ERROR<br>\n";}else{echo "OK<br>\n";} } ?> </body></html>
Thats the latest version of phpMyAdmin (2.2.1)Originally posted by demise
I think I saw somewhere where you could check each one off
of phpmyadmin?Originally posted by gyrbo
I'm gonna make a better version of it soon.