diff options
author | Bart van Bragt <bartvb@users.sourceforge.net> | 2001-04-09 19:52:49 +0000 |
---|---|---|
committer | Bart van Bragt <bartvb@users.sourceforge.net> | 2001-04-09 19:52:49 +0000 |
commit | 3fe9ed7921326950381cdc5e7babf1d0d219f44a (patch) | |
tree | 2f57bdb345a52e5b5e935fe0a22b9acf8cd0d9b4 /phpBB/develop/nuke-db.php | |
parent | 9cabdd8656d75ded8d75799455a0c30c1414155c (diff) | |
download | forums-3fe9ed7921326950381cdc5e7babf1d0d219f44a.tar forums-3fe9ed7921326950381cdc5e7babf1d0d219f44a.tar.gz forums-3fe9ed7921326950381cdc5e7babf1d0d219f44a.tar.bz2 forums-3fe9ed7921326950381cdc5e7babf1d0d219f44a.tar.xz forums-3fe9ed7921326950381cdc5e7babf1d0d219f44a.zip |
Added tool to delete contents of a DB
git-svn-id: file:///svn/phpbb/trunk@141 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop/nuke-db.php')
-rw-r--r-- | phpBB/develop/nuke-db.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/phpBB/develop/nuke-db.php b/phpBB/develop/nuke-db.php new file mode 100644 index 0000000000..1e0167cec5 --- /dev/null +++ b/phpBB/develop/nuke-db.php @@ -0,0 +1,48 @@ +<?php +// Just a handy script to completely wipe out the contents of a +// database.. Use with caution :) + + +if(!isset($submit)) +{ + ?> + <FORM ACTION="<?php echo $PHP_SELF?>" METHOD="post" > + <table> + <tr> + <td>DB host:</td> + <td><INPUT TYPE="text" name="dbhost" value="localhost"></td> + </tr><tr> + <td>DB name:</td> + <td><INPUT TYPE="text" name="dbname" value="phpBB"></td> + </tr><tr> + <td>DB username:</td> + <td><INPUT TYPE="text" name="dbuser" value="root"></td> + </tr><tr> + <td>DB password:</td> + <td><INPUT TYPE="password" name="dbpass"></td> + </tr></table> + <INPUT TYPE="submit" name="submit" value="Submit"> + </FORM> + <?php +} +else +{ + $dbuser = 'bartvb'; + $dbpass = 'bvbdb='; + $dbname = 'welsh_forum'; + $dbhost = 'localhost'; + + mysql_connect($dbhost, $dbuser, $dbpass); + mysql_select_db($dbname); + + $result = mysql_query("SHOW TABLES"); + while($row = mysql_fetch_row($result)){ + $table = $row[0]; + print "Going to drop $table..."; + mysql_query("DROP TABLE $table") || die(); + print "Done.<br>\n"; + flush(); + } +} +?> + |