TeddyKiller Posted April 18, 2010 Share Posted April 18, 2010 How can I check if a table name exists? $tablename contains the table name. Link to comment https://forums.phpfreaks.com/topic/198911-checking-if-a-table-name-exists/ Share on other sites More sharing options...
trq Posted April 18, 2010 Share Posted April 18, 2010 Assuming your talking about a database table you would need to execute a.... SHOW TABLES query. Link to comment https://forums.phpfreaks.com/topic/198911-checking-if-a-table-name-exists/#findComment-1044100 Share on other sites More sharing options...
Mchl Posted April 18, 2010 Share Posted April 18, 2010 Or: SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'databaseName' AND TABLE_NAME = 'tableName' Link to comment https://forums.phpfreaks.com/topic/198911-checking-if-a-table-name-exists/#findComment-1044101 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.