The id of the last sql insert in that scripts execution (not say, another competing insert for another user).
When you have 3
inserts, it gets you the lastInsertId() like it states, the LAST one, not all 3, not 2... just the last one. Combat this by running your inserts individually and fetching the id, OR just search based on insert criteria if you need to pull that data again.inserts by different users/session, see answer #1, thelastInsertId()
applies for the specific user/session/execution, not for all operations. There are basic MYSQL db temp operations happening in the background as well that would return ids if that was true.
Hope that helps.