| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Paul DuBois | Date: | February 17 2003 4:21pm |
| Subject: | Re: Checking existence of a table. | ||
| View as plain text | |||
At 11:10 -0500 2/17/03, <ed@stripped> wrote: >What query would I use to check for an existence of a table within a >database? I'm currently writting a set of scripts in php. Is this possible >with MySQL or do I need to create a condition within PHP? You can check the output of SHOW TABLES or you can issue the following query and see if it produces an error (if so, the table doesn't exist): SELECT * FROM tbl_name WHERE 0 The WHERE 0 part prevents the query from returning rows if the table does exist. > >Thanks, > >Ed > >mysql
| Thread | ||
|---|---|---|
| • Checking existence of a table. | ed | 17 Feb |
| • Re: Checking existence of a table. | Paul DuBois | 17 Feb |
| • Re: Checking existence of a table. (finished) | ed | 17 Feb |
| • Re: Checking existence of a table. | Jerry | 17 Feb |
| • RE: Checking existence of a table. | Don Read | 17 Feb |
| • Re: Checking existence of a table. | Stefan Hinz | 17 Feb |
| • RE: Checking existence of a table. | Simon Green | 17 Feb |
