[eluser]Jônatan fróes[/eluser]
I guess it is simple to solve:
A have a table called
users with a
login field.
The validations is working correctly when i'm inserting new data (I'm using the rules "unique" and "required")
The problem happens when I try to update this table:
The "unique" validation check if the value exists and always returns TRUE 'cos i'm updating.
I don't know how, but I need a rule the returns a query like this:
Code:
SELECT COUNT(*) FROM users WHERE login='{$login}' AND id!={$this->id}
Regards