dwex Posted August 4, 2010 Share Posted August 4, 2010 tried mysql_insert_id but dont think this is the one that I need. Link to comment https://forums.phpfreaks.com/topic/209787-how-to-get-the-next-avaliable-id-of-a-table/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 4, 2010 Share Posted August 4, 2010 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. Link to comment https://forums.phpfreaks.com/topic/209787-how-to-get-the-next-avaliable-id-of-a-table/#findComment-1095090 Share on other sites More sharing options...
dwex Posted August 4, 2010 Author Share Posted August 4, 2010 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. Link to comment https://forums.phpfreaks.com/topic/209787-how-to-get-the-next-avaliable-id-of-a-table/#findComment-1095098 Share on other sites More sharing options...
dwex Posted August 4, 2010 Author Share Posted August 4, 2010 thx for replying tho solved. Link to comment https://forums.phpfreaks.com/topic/209787-how-to-get-the-next-avaliable-id-of-a-table/#findComment-1095109 Share on other sites More sharing options...
kenrbnsn Posted August 4, 2010 Share Posted August 4, 2010 What was the solution? Link to comment https://forums.phpfreaks.com/topic/209787-how-to-get-the-next-avaliable-id-of-a-table/#findComment-1095110 Share on other sites More sharing options...
dwex Posted August 4, 2010 Author Share Posted August 4, 2010 hahah , it was what I thought that wouldn't be the solution. mysql_insert_id Link to comment https://forums.phpfreaks.com/topic/209787-how-to-get-the-next-avaliable-id-of-a-table/#findComment-1095119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.