Jump to content

How to get the next avaliable ID of a table?


dwex

Recommended Posts

You generally DON'T ever need to get the next id in a table. You insert the actual data and then get the actual id that was just assigned because if you have concurrent visitors causing data to be inserted you cannot guarantee the order in which queries will be executed unless you lock the table.

I actually have to store that table's column ID to other tables' columns aswell when I'm Inserting a new data into the column so if I assign an ID , the other tables' columns wont be getting that column's ID because only after I insert then there will be an ID assigned.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.