alecjw Posted August 6, 2006 Share Posted August 6, 2006 Is there a MySQL query which returns whether a table exists or not? Quote Link to comment Share on other sites More sharing options...
king arthur Posted August 6, 2006 Share Posted August 6, 2006 "SHOW TABLES" will return rows containing the table names in the database. Quote Link to comment Share on other sites More sharing options...
fenway Posted August 7, 2006 Share Posted August 7, 2006 And you can add a "LIKE" clause to show tables as well, and check for any rows returned. Quote Link to comment Share on other sites More sharing options...
alecjw Posted August 7, 2006 Author Share Posted August 7, 2006 So would that query return array("table1_name","table2_name") etc? Quote Link to comment Share on other sites More sharing options...
fenway Posted August 7, 2006 Share Posted August 7, 2006 If you ask for an array back, then yes... it will return a recordset, with a single column. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.