Yelgnidroc
05-14-2008, 10:52 AM
I have an on-line order system where many customers can place an order.
I need to have an order number, and increment it each time a new order number is issued. I don't want to lose any order numbers, or duplicate any.
If I use the following statement from php will the update be atomic i.e. between the two statements no other user can access the data.
$query = "SELECT `on` FROM order_number; UPDATE order_number set `on` = `on`+1;";
mysql_query($query);
Would it make any difference which engine I used?
I need to have an order number, and increment it each time a new order number is issued. I don't want to lose any order numbers, or duplicate any.
If I use the following statement from php will the update be atomic i.e. between the two statements no other user can access the data.
$query = "SELECT `on` FROM order_number; UPDATE order_number set `on` = `on`+1;";
mysql_query($query);
Would it make any difference which engine I used?