Title: Droping Database Tables.
Last modified: August 18, 2016

---

# Droping Database Tables.

 *  [cron](https://wordpress.org/support/users/cron/)
 * (@cron)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/droping-database-tables/)
 * I have recently upgraded to wp 2.0 from wp 1.5 and I would like to delete ALL
   the info in my SQL tables and start over again. Since I do not have acess to 
   PhpMyAdmin or similar programs I have decided to write a php script that would
   deleate all the info in my tables. So far I have:
 * <?php
    // Connect to database $connect = mysql_connect('localhost', 'USERNAME','
   PASSWORD') or die('Could not connect: ' . mysql_error()); echo 'Connected successfully';//
   Select Database mysql_select_db('DATABASE') or die('Could not select database')
 * // Deleating
    $delete = 'WTF GOES HERE?'; $result = mysql_query($delete) or die('
   Failed to delete: ' . mysql_error());
 * // Close Connection
    mysql_close($connect); ?>
 * my question is what should go in the $delete place to acomplish this?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [skulled](https://wordpress.org/support/users/skulled/)
 * (@skulled)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/droping-database-tables/#post-316468)
 * Depending on how familiar you are with the `mysql` functions in PHP, you have
   two options:
 * 1. Get the list of all the tables that you have in the database manually, and
   then run the following as your `$delete`:
 * `$delete = "DROP TABLE TABLENAME";`
 * 2. Take a look here:
 * [http://se.php.net/manual/en/function.mysql-list-tables.php](http://se.php.net/manual/en/function.mysql-list-tables.php)
 * And then write out a loop to run through all the tables found in your database,
   and run a similar `$delete` command for each table.
 * Hope this helps. Be CAREFUL and BACKUP your database before you do this, since
   it cannot be reversed, and if something goes wrong you should still have your
   data.
 *  Thread Starter [cron](https://wordpress.org/support/users/cron/)
 * (@cron)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/droping-database-tables/#post-316475)
 * Ok, sounds good, now to see if it works as sugested. I will post my results here.
 * Thanks for your help.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Droping Database Tables.’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [cron](https://wordpress.org/support/users/cron/)
 * Last activity: [20 years, 5 months ago](https://wordpress.org/support/topic/droping-database-tables/#post-316475)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
