rules - check if email is in use
$check=db_select('users','u')
    -&gt;fields('u',array('uid'))
    -&gt;condition('mail','user email comes here','=')
    -&gt;execute()
    -&gt;fetchField();

if($check!='')
{
    form_set_error('mail','Email Already Exists');
}


You can use this.