1、通過information_schema查詢數據庫是否存在某張表
select t.table_name from information_schema.TABLES t where t.TABLE_SCHEMA ='".$database."' and t.TABLE_NAME ='".$table."';
$database:查詢的數據庫
$table :查詢表格
返回:若存在則返回表名,不存在返回為空
2、判斷表中一個字段是否存在
select count(*) from information_schema.columns where table_name = '表名' and column_name = '字段名'
select count(*) from information_schema.columns where table_name = 't_iov_vehicle_owner_info' and column_name = 'id'