v5:reference:connection:insert_id
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
v5:reference:connection:insert_id [2019/07/08 22:20] – mnewnham | v5:reference:connection:insert_id [2023/06/20 09:39] – [Description] return value is falsey (see #989) dregad | ||
---|---|---|---|
Line 9: | Line 9: | ||
</ | </ | ||
===== Description ====== | ===== Description ====== | ||
- | The function '' | + | The function '' |
- | The value retrieved is **connection based**, meaning that each concurrent connection (even if multiple connections are associated with the same procedure) has its own instance of the number. | + | The value retrieved is **connection-based**, meaning that each concurrent connection (even if multiple connections are associated with the same procedure) has its own instance of the number. |
It is important to remember that there is only a single storage instance for the number, and if one insert statement with an auto-increment number succeeds another, the insert_id value for the second statement will overwrite the value of the first, so retrieve the value of the first before executing the second. | It is important to remember that there is only a single storage instance for the number, and if one insert statement with an auto-increment number succeeds another, the insert_id value for the second statement will overwrite the value of the first, so retrieve the value of the first before executing the second. |
v5/reference/connection/insert_id.txt · Last modified: 2023/06/20 09:40 by dregad