SQL 判断表是否存在 数据表不存在是致命错误

        // 判断表是否存在
        $db_info = explode ( '.', $table );
        $db_name = $db_info [0];
        $t_name = $db_info [1];
        $t_sql = "SHOW TABLES from $db_name LIKE '{$t_name}'";
        $re = $this->mysql->getAll ( $t_sql );

 

posted @ 2019-06-27 18:31  一粒小米-博客  阅读(580)  评论(0编辑  收藏  举报