• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

PLease help , very stupid question

scarfication

New Member
Hi,

can anyone tell me what the command to drop all tables in a database, im using phpmyadmin

thnx in advandce!

scarfication
 
why do not you delete the datbase then create it again and you will have the datbase without tabkes
 
i've got it from a free host provider so that isn't pssible
it are 109 tabels so i need to delete them at a fast way

Thnx in advandce

scarfication
 
yay! got it, the first time i searched in the forum, i didn't saw a thread who had the answer a guy made a drop table script

<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>

so now i can delete all my tables (i coulnd't delete my db because thatoption was disabled)

scarfication
 
Back
Top