关于Trying to access array offset on value of type bool报错

正在查看 2 个帖子:1-1 (共 1 个帖子)
  • 作者
    帖子
  • ygdm123
    • 文章数量: 25
    @ygdm123
    楼主

    <br />
    <b>Warning</b>: Trying to access array offset on value of type bool in <b>/www/wwwroot/tsingshu.ssf.moe/user/reg.php</b> on line <b>64</b><br />

    源码为

    $md5_status=true;
    while($md5_status) {
        $md5 = md5($post['name'] . $post['mail'] . rand());
        $md5_result=mysqli_query($connect,"SELECT * FROM user WHERE user_token=".$md5);
        if(!$md5_result['user_id']){//64行
            $md5_status=false;
        }
    }
    

     

    来自台州, 浙江, 中国
    孙锡源
    • 文章数量: 704
    @ibadboy

    mysqli_query 方法执行失败了。估计是返回了 false,然后你对 false 执行数组偏移操作当然会报错。

    来自张家口市, 河北省, 中国
正在查看 2 个帖子:1-1 (共 1 个帖子)
  • 哎呀,回复话题必需登录。

话题信息