chelnov63 Posted July 30, 2008 Share Posted July 30, 2008 hi i havent worked to much with relationships between tables, so this maybe a kind of a newbie question: I have two tables, one is a list of activities, the other a list of participants. I want to insert one record in the activities table and then using its identity column as foreign key, I want to insert two or more records into the participants table. My problem is that I have no idea what foreign key to use when inserting names into the participants table. How can I get hold of the row's key or identity column, immediately after inserting a row into the activity table? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted July 30, 2008 Share Posted July 30, 2008 Use the mysql_insert_id() function. Quote Link to comment Share on other sites More sharing options...
chelnov63 Posted July 30, 2008 Author Share Posted July 30, 2008 awesome!!! thanks mate!! Quote Link to comment 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.