Im making a invoice system and my client needs invoice numbers in a order like 1,2,3,4 etc...
what i did was add a button to get new invoice then using ajax return last invoice number and add +1 to that number and save
problem is if two people use system at same time there is a possibility that both will get same number :(
what is the best way to solve this ?
Sorry for my bad english, hope someone will understand what i meant