473,385 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Drop multiple tables with same prefix

hsriat
1,654 Expert 1GB
How can I drop all the tables from the database which start with a common prefix (say t1_)?

Query or PHP code... any simple solution?
Feb 28 '09 #1
3 7642
mwasif
802 Expert 512MB
You can drop tables like this. But you can select all tables starting with t1 with the following query
Expand|Select|Wrap|Line Numbers
  1. SHOW TABLES LIKE 't1%'
Use this query in PHP to get all the table and loop through them to drop one table at a time.
Feb 28 '09 #2
hsriat
1,654 Expert 1GB
Thank You mwasif... this worked good and saved my time. :)
Mar 10 '09 #3
mwasif
802 Expert 512MB
You are welcome.
Mar 10 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: john | last post by:
How do u guys handle multiple sessions?? i.e, opening different browser windows by running iexplore.exe or clicking IE icons and opening the application. My sessions are mixing up. what i mean is...
0
by: Oscar Overdijk | last post by:
Well i want to run multiple servers on the same host, has somebody a Howto for this? Host: RedHat 9 and MySQL 4.0.17 Using the following script: VERSION="40017"...
31
by: Alexis Nikichine | last post by:
Hello, It is common knowledge that arrays can be used as hashtables: var color = ; color = 0xFF0000; color = 0x0000FF;
1
by: ANSWER | last post by:
I have two tables with words. First table has 2 fields: German, Croatian. Second table has 2 fields: German, English. First table in the German field miss attributes (der, die, das), (pl). This...
11
by: Randy Harris | last post by:
I have been using "IN" to query tables in Oracle from MS Access very successfully. Select Field FROM MyTable IN [ODBC...etc Works great if there is only one table involved. Anyone know how I...
1
by: Jeff Gardner | last post by:
Greetings: I have a table with 3 pieces of data that I would like to use to dynamically populate 3 drop downs using javascript. The fields are state, orgname, office. If it's not already...
4
by: pagelogix | last post by:
I'm looking for a way to drop multple tables at the same time from my access database. Any ideas? Thanks.
9
by: sliderip | last post by:
In Access 2003, is it possible to delete multiple tables using a QUERY? I want to delete multiple tables but i guess i cant use wildcards with DROP i..e DROP TABLE mytable1% or something like...
2
by: John Sherling | last post by:
I'm using 4.1.13a of mysql. Want to know if there's an easy way to dro pall databases that share a common prefix, using a single command. So if my databases are: uesr1_coolDB1...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.