I am trying this code to check if there is any account with the same e-mail that is send in a new registration.
Why var_dump($arr_user_db); output one result if the value of $email is new in the database?
public function checkUserDatabase($email=null, $id_fb=null) {
if(!is_null($email) && is_null($id_fb)){
unset($arr_user_db);
$arr_user_db = $this->User->find('first', array('conditions' => array('User.email' == $email)));
var_dump($email); //string 'mersdfsdfda@example.com' (length=28)
var_dump($arr_user_db);//output an account.
}
}
should be: