I have to create Customer/agent relationship, in which each agent may handle 100 customers, and each customer will have order/position/priority to handle. And when i update a customer’s order/position/priority to some other priority.
For example from 5 to 25 then the position already occupied customer needs to go one step down 24 so then the 24 th to 23 it will goes upto the 6 th customer goes to 5th.
So is there anyway to have custom sql query or php script (For loop can do that, but i want something else if it is possible)) to handle this situation.
Preferablu it should be done within a transaction.