I have a database which people can log into to enter information. What I want is to use the same log in details so that the person can log in and review all the information they have entered into the database.
So basically I have one table with id, studentName , username and password
I then have a separate table called entry which stored the information which they enter with the fields
id, studentName, textfield1,textfield2, etc ….
So what I want is to write a mysql query which takes the person username from the login page, looks at the related studentName field in the users table and make use of this to fetch all records from the entry table where this name is present.
Is this possible?
Thanks in advance.
Regards
Matt
in your entry table, add a reference to your students table via id (preferably id since it’s most likely unique if you use auto_increment)
Then everytime you need to fetch, do something similar to
SELECT * FROM entry where studentId = $loggedInUserId