php - getting the query from database - Codeigniter -
i wanted check whether username exists in database, codeigniter throwing
error: can't use method return value in write context.
the code follows:
public function check_username_exists($username){ $query = $this->db->get_where('users', array('username' => $username)); if(empty($query->row_array())){ return true; }else{ return false; } }
$result = $query->row_array(); if(empty($result)){ return true; }else{ return false; }
Comments
Post a Comment