alecjw Posted August 6, 2006 Share Posted August 6, 2006 Is there a MySQL query which returns whether a table exists or not? Link to comment https://forums.phpfreaks.com/topic/16742-table-exists/ 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. Link to comment https://forums.phpfreaks.com/topic/16742-table-exists/#findComment-70409 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. Link to comment https://forums.phpfreaks.com/topic/16742-table-exists/#findComment-70475 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? Link to comment https://forums.phpfreaks.com/topic/16742-table-exists/#findComment-70548 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. Link to comment https://forums.phpfreaks.com/topic/16742-table-exists/#findComment-70617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.