1. 程式人生 > >檢視mysql資料庫是否存在某張表

檢視mysql資料庫是否存在某張表

通過information_schema查詢資料庫是否存在某張表

select t.table_name from information_schema.TABLES t where t.TABLE_SCHEMA ='".$database."' and t.TABLE_NAME ='".$table."';
$database:查詢的資料庫
$table :查詢表格

返回:若存在則返回表明,不存在返回為空