[PHP-DB] DROP tables with prefix match

2002-05-15 Thread John Hughes

I need to rebuild a PHP-mySQL site that has an extensive table
structure. Is there a way to DROP all tables that start with a
certain prefix?

__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] DROP tables with prefix match

2002-05-15 Thread Beau Lebens

if it's only a one-off thing, you could use php to get all table names
(mysql_list_tables) and then go thru and create an array of the names that
match your criteria, then go thru that array and DROP each one progressivly.

HTH

Beau

// -Original Message-
// From: John Hughes [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 16 May 2002 7:41 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] DROP tables with prefix match
// 
// 
// I need to rebuild a PHP-mySQL site that has an extensive table
// structure. Is there a way to DROP all tables that start with a
// certain prefix?
// 
// __
// Do You Yahoo!?
// LAUNCH - Your Yahoo! Music Experience
// http://launch.yahoo.com
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] DROP tables with prefix match

2002-05-15 Thread Jason Wong

On Thursday 16 May 2002 07:40, John Hughes wrote:
 I need to rebuild a PHP-mySQL site that has an extensive table
 structure. Is there a way to DROP all tables that start with a
 certain prefix?

If you have access to the server running mysql then you could try deleting the 
actual files holding the tables. If you're using MyISAM tables then each 
table is held in 3 files -- table.frm, table.MYD, table.MYI

*** WARNING ***
I've not tried this before. It may be a good idea to backup your data first :)
*** WARNING ***


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Adapt.  Enjoy.  Survive.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php