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

libGdx unable to find files in android application data directory -

php - Webix Data Loading from Laravel Link -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -