MySQL/PHP: How to insert logged in user id into another table that is gathering data from a form tha
Posted
by Lisa
on Stack Overflow
See other posts from Stack Overflow
or by Lisa
Published on 2010-05-10T13:06:48Z
Indexed on
2010/05/10
13:14 UTC
Read the original article
Hit count: 193
For the first time I am needing to join information from two tables and am quite nervous about doing it without any advice first.
Basically, I am building a secure site that is accessed by authorised users. I have my login table with user_id, username, password
Once the user is on the site, they have the option of inputting data into another table called input. At the moment this table only captures the information that is entered, not the user_id or username of the inputter.
I would like the form to be able to input the user_id and/or username from the login table into the input table.
Please could somebody talk me through this process?
I am sure that once this is amended, I will then be able to use the table to only allow the logged in user to access the information that he or she have inputted, is that correct?
Many thanks
© Stack Overflow or respective owner