Jump to content

Inserting Primary ID into another table


lutzlutz896

Recommended Posts

I have been trying to figure this out, but can't seem to comprehend how it is done. I know how to use a form to insert data into a database table, and have that table create a unique ID (primary key). My problem is that once the user signs up and creates an account, there is another form in which they will fill out to list their products on the website. Of course the second form stores information into a different table. What I can't figure out is how to pass the primary key from one table, to another table, so that the two tables will be connected.

I know that the user can't possibly enter in the information, because they don't know what thier unique ID is since that is created by the database itself. I'm not sure how this is done, but I know that I need the unique ID from one table to be inserted into the other table so that it corresponds with the correct user. I have been looking through PHP books, but I can't find any information on how to do this. Any help would be much appreciated.

Thanks,

Jonathan
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.