Results 1 to 4 of 4

Thread: clear mysql database

  1. #1

    Thread Starter
    Lively Member jonvantuyl's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    75

    clear mysql database

    i would like to clear a mysql database through php. i have a database and would like to clear it but i cant just delete it and then create a new one (cause it takes about 1 day or so for it to process) so is there a way that i can just have it clear all tables and everything from inside the database? thanks

  2. #2
    Hyperactive Member vbuser1976's Avatar
    Join Date
    Sep 2000
    Location
    Yonkers, NY
    Posts
    404

    Arrow Hmm...

    I have never worked with php, but I am familiar with sql. Use this SQL query when you want to clear the table but not delete it:

    Delete * from tblName1

    That should clear out your table for reuse. Now, if you want to delete certain records based on a condition, you add this next line of code to the one above:

    where field1 = ('string' or number or whatever)

    I hope this is what you are looking for. Good Luck and let me know if this works for you.

    Now that I reread your question, I have another idea. You do not want to delete the database, right? Well, another way is to drop the table all together(if you need to) and then recreate it. Here is how you drop a table(I am not sure if mysql supports this, but try it):

    DROP Table Table_Name

    But I doubt you want to do this. The above stuff about deleting is a better idea, but just thought you might need this.
    Last edited by vbuser1976; Sep 21st, 2001 at 09:14 AM.
    -vbuser1976
    VB6 Enterprise SP6
    SQL 7.0 SP2
    VBScript, HTML, Javascript, C++, a little UNIX

  3. #3
    scoutt
    Guest
    or you can get a gui, sort of, from www.phpwizard.net and download a program called phpMyAdmin. it works miracales, well almost

  4. #4

    Thread Starter
    Lively Member jonvantuyl's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    75

    Talking k

    thank you both........


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width