dwex Posted August 4, 2010 Share Posted August 4, 2010 tried mysql_insert_id but dont think this is the one that I need. Quote 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. Quote 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. Quote 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. Quote 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? Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.