Best Approach to Generate Unique Order Number with concurent inserts in Sales Application - Mysql/PHP -


we have sales application generating unique order number adding increment in previous value. since using unique combination based on orderid , store id, can not use auto increment. sometime getting duplicate order ids if request submitted multiple client devices.

can please advise better way handle order id generation based on order id , store id? using php scripting language.

this have of now.

// table structure  salesorders (order_id, store_id)  $generatenextorderid = "select max(order_id) + 1 salesorders store_id = 1"; 

any suggestions?


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -