Attach User Id to inserted records
I'm building a page/form that will allow users to add new rows to my database. I want to auto-populate the 'student_id' column in the table they are inserting into with the information contained in my table 'users' that contains their login information. In both tables, their numeric id is 'student_id'. I have their username = their email.
How is this done?
to recap, i have them inserting rows into a table called sponsors. I want the column sponsors.student_id to autopopulate with their student_id from the users table based on the fact that they are logged in as said user.
I know this must be possible, but I'm incredibly new to all of this.
Thanks in advance for any help!
