Lv-Kris Posted February 16, 2007 Share Posted February 16, 2007 I have a need to insert the same user_id from users table into another table upon registering, however in the users table user_id is an auto incrementing number. If i put user_id of table2 auto incrementing there could be some id mixing if many people register at once. Maybe i could somehow link both id's? I was thinking about inserting another register page where if the id is not found, it inserts it... Any ideas about solving this? Hope You get my idea... Kris Quote Link to comment https://forums.phpfreaks.com/topic/38766-inserting-user_id-in-other-tables/ Share on other sites More sharing options...
arianhojat Posted February 16, 2007 Share Posted February 16, 2007 using php? can use in variable right after insert... mysql_insert_id() or return it from another query after previous Insert query if not using php. SELECT LAST_INSERT_ID() as lastRow; Quote Link to comment https://forums.phpfreaks.com/topic/38766-inserting-user_id-in-other-tables/#findComment-186312 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.