I have a for where you capture new user information. I generate a member number by getting an incremented last number . What happen now, is 2 admin users create 2 new users from different sites, Both get the same last id and when one trying to save it , the getting errors because the first admin users now already saved his user with the same last number. here is basically what I do
id_count is an AI field
The Admin select add user from the front end.
the following query run and bring back the last number
SELECT id_count FROM members order by id_count DESC Limit 1
member_id = $row['id_count'] +1
now if i have 2 admin users doing this at exactly the same time. both get the same new member number. Admin1 safe his user and it is fine. Now when Admin2 safe the information the new number already exist and information don't safe. member number is unique field