Use below php script and run through browser…

<?php
/* fill in your database name */
$database_name = "database";

/* connect to MySQL */
if (!$link = mysql_connect("server", "username", "password")) {
 die("Could not connect: " . mysql_error());
}

/* query all tables */
$sql = "SHOW TABLES FROM $database_name";
if($result = mysql_query($sql)){
 /* add table name to array */
 while($row = mysql_fetch_row($result)){
 $found_tables[]=$row[0];
 }
}
else{
 die("Error, could not list tables. MySQL Error: " . mysql_error());
}

/* loop through and drop each table */
foreach($found_tables as $table_name){
 $sql = "DROP TABLE ".$database_name.".".$table_name." <br>";
 if($result = mysql_query($sql)){
 echo "Success - table $table_name deleted. <br>";
 }
 else{
 echo "Error deleting $table_name. MySQL Error: " . mysql_error() . "<br>";
 }
}
?>

 Leave a Reply

(required)

(required)


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2014 Developers Corner Suffusion theme by Sayontan Sinha