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

python - Creating a new column in a dataframe based on the result of the addition of three others -

string - Using python and postgres, variables within execute function? -