[eluser]brixxster[/eluser]
Hello Guys, here I am again, the newbie
I have this code in the controller which captures an email from a form. I wanted to check if the email is already in the database and show "email found" if it is indeed found. The problem I get a
Quote:Call to a member function num_rows() on a non-object
. What do you think I am doing wrong here sirs?
Thanks.
The Controller
Code:
$this->load->model('model_pwreset');
$testEmail = $this->input->post('email');
$emailCheck = $this->model_pwreset->pw_getemail($testEmail);
if($emailCheck->num_rows() > 0 ){
echo "email found";
}
The Model
Code:
function pw_getemail($email)
{
$this->db->select('email');
$this->db->from('account');
$this->db->where('email', $email);
$this->db->get();
}