zoukankan      html  css  js  c++  java
  • Thinkphp table doesn't exist

    系统采用Tp3.2的改造....集群为Mysql双工模式:
    平时M()主要是操作写,MS操作读。。。今天在查询

    $res =MS("user u")->join("{$per}user_info x ON x.uid = u.id")->where("u.id = $uid")->find();
    var_dump($res);//false

    始终为false.....而通过getLastSql输出的原生sql后:M()->query('sql 语句');返回有记录集。。。
    猜测是mysql错误,于是:

    $res =MS("user u")->join("{$per}user_info x ON x.uid = u.id")->where("u.id = $uid")->find();
    var_dump($res);//false
    if(false === $res ){  
        echo MS("user u")->getDbError();   //输出Table 'user_info' doesn't exist
    }  

    CURD操作如果返回值为false,则表示数据库操作发生错误,这个时候就需要使用模型的getDbError方法来查看数据库返回的具体错误信息。
    由此看来,问题就在集群数据表同步问题上(服务器集群是innodb,user_info是Myisam,问题可能就在这里).......统一改成M(读写方式)解决OK......
    也希望大家每天都有一点点成果,每天都有一点点进步。






  • 相关阅读:
    golang 中 sync包的 WaitGroup
    Go_20: Golang 中 time 包的使用
    mysql 同步数据到 ElasticSearch 的方案
    mysql 对应 binlog 查看
    python3.6爬虫总结-01
    Golang 之协程详解
    golang私服搭建
    Ubuntu vim设置
    密码校验规则
    golang密码校验
  • 原文地址:https://www.cnblogs.com/phpper/p/7679429.html
Copyright © 2011-2022 走看看