On Tue, Apr 24, 2001 at 04:20:26PM -0400, Mark Riehl wrote: > All, > > What's the easiest way to check and see if a table already exists in a > database? I'm running MySQL on a Win2k box. > > The New Riders MySQL book has the following statements: > SELECT COUNT(*) FROM table_name > SELECT * FROM table_name WHERE 1=0 > > Each statement will succeed if the table exists. > > Any other way (other than calling $dbh->tables() and looping through the > results? SELECT 1 FROM table_name (just another variant of yours). -- Thomas Eibner - <http://thomas.eibner.dk/>
Re: Easiest way to tell if a table already exists?
Thomas von Elling Skifter Eibner Tue, 24 Apr 2001 14:05:42 -0700
- Easiest way to tell if a table already ex... Mark Riehl
- Re: Easiest way to tell if a table a... Thomas von Elling Skifter Eibner
- Re: Easiest way to tell if a table a... Mark Thornber
- RE: Easiest way to tell if a table a... Neil Lunn
- Re: Easiest way to tell if a tab... Mike Schienle
- RE: Easiest way to tell if a... Sterin, Ilya
- RE: Easiest way to tell ... PD Miller
- RE: Easiest way to tell if a table a... Neil Lunn
- Re: Easiest way to tell if a tab... Mike Schienle
- RE: Easiest way to tell if a table a... Neil Lunn
- Re: Easiest way to tell if a tab... Michael A. Chase