mysql中的操作记录

第一:判断数据库中是不是存在某张表

Db::query("SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='".config('database.database')."' AND table_name='".$data['tag_table']."'");

如果存在就会返回1  如果不存在就会返回0

第二:判断数据表中是否存在某个字段

猜你喜欢

转载自my.oschina.net/u/3911977/blog/2396161