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

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -