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

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -