Home  >  Q&A  >  body text

Why does it keep saying that the user cannot be found? It is clearly in the database.


$result = $this -> validate($data,$rule,$msg);

//If the verification passes Execution

if($result === true){

//Construct query conditions

$map = [

'name' => $data['name'],

'password' =>md5($data['password']),

];


//Query user information

$user = UserModel::get($map);

if($user == null){

$result = 'The user was not found';

}else {

$status = 1;

$result = 'Verification passed, click [Confirm] to enter';

//Use session to set user login information

Session::set('user_id',$user->id); //User ID

session::set( 'user_info',$user->getData()); //Get all user information


//Update user login times: increase by 1

                                                                            $user -> setInc('login_count'); 'message'=>$result,'data'=>$data];

}

##
轻微强迫症轻微强迫症2311 days ago2270

reply all(1)I'll reply

  • Ж墨竹疏影Ж

    Ж墨竹疏影Ж2018-10-14 20:04:39

    I also encountered the same problem. When logging in with admin, it said that the user does not exist, but it is clearly in the database; logging in with peter was no problem. I don't know what's going on either

    reply
    0
  • Cancelreply