美文网首页
thinkPHP 如何判断某个数据表是否存在?

thinkPHP 如何判断某个数据表是否存在?

作者: YasinWei | 来源:发表于2017-09-15 15:21 被阅读0次

    代码如下:

    $exist = M()->query("show tables like 'chat_message'");

    if ($exist) {

            echo "exit";

    }else {

             echo "no exit";

    }

    其中chat_message就是某个表的表名,包含前缀。

    相关文章

      网友评论

          本文标题:thinkPHP 如何判断某个数据表是否存在?

          本文链接:https://www.haomeiwen.com/subject/tmnssxtx.html