I want to check if an email already exists in the database. I'm doing the following.
$this->load->database();
$query = $this->db->get_where('usuario', array('email'));
$result = $query->result_array();
if(count($result) > 0) {
echo "email existe";
} else { echo "email não existe";}
It always returns me that the email already exists even if I type a different one. Where is my mistake? Or am I doing wrong and have another way?