I am having a huge disconnect with a PHP/SQL concept that seems like it would be fairly common and somewhat straight forward. Could someone please push the new guy in the right direction? I have been searching for hours on this. :-\
I have created a database with two tables. One is admin, and the other is called survey_answers. They both have id’s in the tables. The problem comes when the user logs on to the site. I can’t figure out how to connect the user who is logging in, to a specific ID in my database. Aka I can’t keep the survey answers submitted connected to the user who submitted it
Example: Jimmy is ID #3 in the admin database, and logs into the website. When he is directed to the survey php page he answers the questions. I look at the results in the database(phpmyadmin) and the answers fill the next available spot in the survey_answers table. Basically they add in sequential order. They don’t tie to the user who just submitted them.
So if user #17 is the first one to fill out my survey, his answers will always attach to ID #1 in the survey_answers table. But I want them to attach to id#17 in the survey_answers table. How does one get a users information correlated with the correct ID#?
I realize I am missing a huge piece of the puzzle here, but anything would help. Even a few videos on youtube etc. The only idea I had was to do a joint command with the two tables.
Thanks in adavnce