转换为字符串错误

时间:2017-02-21 05:57:07

标签: php mysql

可捕获的致命错误:

  

类mysqli_result的对象无法在行中转换为字符串:99

如何解决此错误?

if($login_data)
    {
       $user_id = $login_data->id;
       $login_data=$this->session->set_userdata(array('user_id'=>$user_id));
      // print_r($login_data);
       return redirect("user/dashboard/");
          }

1 个答案:

答案 0 :(得分:0)

您的$ phone变量覆盖了原始变量。试试这个:

更改

$phone = mysqli_query($this->connection,"SELECT Phone from Users WHERE Phone = '$phone'");

$phone_exist = mysqli_query($this->connection,"SELECT Phone from Users WHERE Phone = '$phone'");