checking if a table exists
Moderator: General Moderators
checking if a table exists
How would you check to see if a mysql table exists?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
SHOW TABLESCode: Select all
SHOW TABLES LIKE 'someName'- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Depending on what you are doing, you may be able to something like this...
Code: Select all
DROP TABLE IF EXISTS `table_name`;
CREATE TABLE IF NOT EXISTS `table_name` (...