|
-
Sep 20th, 2001, 10:52 PM
#1
Thread Starter
Lively Member
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
-
Sep 21st, 2001, 09:08 AM
#2
Hyperactive Member
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
-
Sep 21st, 2001, 10:34 AM
#3
or you can get a gui, sort of, from www.phpwizard.net and download a program called phpMyAdmin. it works miracales, well almost
-
Sep 21st, 2001, 12:07 PM
#4
Thread Starter
Lively Member
k
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|