Hi,
I have a question concerning table fields that have been declared to be incremented by one automatically on every INSERT.
When I try to insert a row in a table, I have to specifically provide the number even on the field that's supposed to be incremented automatically.
This is a bummer, since I don't want to add extra steps to take the max value of that column and add one to that number in the next INSERT statement.
The main reason why I don't want to do the extra steps is not the work, but because it can lead to errors in cases where two users have accessed the same max number within a short amount of time, and then they will both try to insert the same number which will lead to fealure (if the key is unique).
Anyway, sorry I took so long. Does anyone have an example (preferably with PHP) where you don't have to provide the number for a field that's supposed to be incremented by one automatically.
Thanks for your help.
I have a question concerning table fields that have been declared to be incremented by one automatically on every INSERT.
When I try to insert a row in a table, I have to specifically provide the number even on the field that's supposed to be incremented automatically.
This is a bummer, since I don't want to add extra steps to take the max value of that column and add one to that number in the next INSERT statement.
The main reason why I don't want to do the extra steps is not the work, but because it can lead to errors in cases where two users have accessed the same max number within a short amount of time, and then they will both try to insert the same number which will lead to fealure (if the key is unique).
Anyway, sorry I took so long. Does anyone have an example (preferably with PHP) where you don't have to provide the number for a field that's supposed to be incremented by one automatically.
Thanks for your help.