Workerman/MySQL的update无法更新

AccessDenied

更新例句:

$row = $MDB->update('connect_wx')->cols(array(
                "nickname"=>$data['nickName'],
                "gender"=>$data['gender'],
                "language"=>$data['language'],
                "city"=>$data['city'],
                "province"=>$data['province'],
                "country"=>$data['country'],
                "avatarurl"=>$data['avatarUrl']
            ))->where('openid= :openid')->bindValues(array("openid"=>$data['openId']))->query();

服务器信息:

Server CenterOS 8
Workerman version:4.0.4
PHP version:7.4.6
MySQL 8.0.20

问题

插入可以,就是更新会出现问题,无法更新,$row是0

3010 1 0
1个回答

AccessDenied
$MDB->update('connect_wx')->cols(array(
                "nickname"=>$data['nickName'],
                "gender"=>$data['gender'],
                "language"=>$data['language'],
                "city"=>$data['city'],
                "province"=>$data['province'],
                "country"=>$data['country'],
                "avatarurl"=>$data['avatarUrl']
            ))->where('openid= :openid')->bindValue("openid",$data['openId'])->query();

更新没有问题,是数据没有变化,所以updatedAt 的 CURRENT_TIMESTAMP 没有更新

  • 朕震惊了 2020-05-18

    $data['openId']传错了吧

  • AccessDenied 2020-05-21

    @3403:没有,小程序获取的字段和数据库字段不一致的,数据库按照微信公众号的返回字段建立的

年代过于久远,无法发表回答
×
🔝