Hello everyone,
I am wondering if it is possible to check *which* rows were updated when a user edits a field.
This is my problem: I have a list of users and it is important that no usernames are repeated. I have already created a function that checks if the username already exists in the database when a user is intially added. However, I am not sure how I can check if, once the username field is *updated*, if the newly updated field already exists.
Obviously, the same function cannot be used when the user is edited because even when the username fieldname is *not* updated, the result will always be "yes, it already exists".
Hopefully you guys can help me brainstorm a solution, I am stuck at the moment.
Thank you :-)
I am wondering if it is possible to check *which* rows were updated when a user edits a field.
This is my problem: I have a list of users and it is important that no usernames are repeated. I have already created a function that checks if the username already exists in the database when a user is intially added. However, I am not sure how I can check if, once the username field is *updated*, if the newly updated field already exists.
Obviously, the same function cannot be used when the user is edited because even when the username fieldname is *not* updated, the result will always be "yes, it already exists".
Hopefully you guys can help me brainstorm a solution, I am stuck at the moment.
Thank you :-)
Comment