[eluser]Pascal Kriete[/eluser]
Callbacks can return one of two things:
- A boolean (TRUE / FALSE) to indicate a passed or failed rule.
- A string that will be used as the new value. Trim, for example, does this.
We check the type of the return value (is_bool()), so in your example you need to explicitly return FALSE if it fails.
Code:
return ($query->num_rows == 1) ? TRUE : FALSE;