I have created several tables that I need to pull information from depending upon the user who entered the data. Therefore, I have created a column in each table called UserID.
I have used Dreamweaver to set up the login-registration page, and the code required on the pages that you want that user to have access to.
My problem is with the UserID. I can not get the same number to come up in each table. Some tables have a repeating region. For example if the user has more than one emergency contact they can enter it.
What I want to do is use that userID in all the other tables that this user enters his information.
This is sort of how I am setting up the tables
UserId
UserName
UserLogin
The next table would have
UserId
Primary_key
FirstName
LastName
Address
and so on
The next table would have
UserId
Primary_key
emergency_contact
emergency_contact_phone
The user enters the information in a form and the UserId and Primary_key are hidden fields.
I have been to several websites, and tried every suggestion on PHP code that they have and after I enter the first form for FirstName and so on I get an error saying UserId can not be null. When I look at the table the UserID is usually empty.
Can someone point me in the right direction as to how to make this happen.
Do you put the PHP code to make this happen at the top of each form the user is entering data or inside the form itself?
Can someone give me a simple code that would make this work?
Thanks for reading this post and any help you may be able to give.