search

Home  >  Q&A  >  body text

Isn’t the passed id converted to 0? What is the purpose of $data['item'] query?

public function add()

{

$id=(int)input('get.id');

$data['item']= $this->db->table('admins')->where(array('id'=>$id))->item();

}

$data['item']=$this->db->table('admins')->where(array('id'=>$id))->item();

Isn’t the passed id converted to 0? What is the purpose of the $data['item'] query?

柠檬不萌^_^柠檬不萌^_^2247 days ago1261

reply all(1)I'll reply

  • 小明

    小明2018-12-05 19:46:08

    Why did the id change to 0? The query should be to check whether the user information exists in the administrator database, and then determine the login.

    reply
    0
  • Cancelreply