Welcome Guest, Not a member yet? Register   Sign In
Problem with DMZ validation "unique"
#1

[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
#2

[eluser]7amza[/eluser]
post your code here and i'll try to help if i can.




Theme © iAndrew 2016 - Forum software by © MyBB