Currently I have 4 tables.
In this system, there’s 2 user: applicant and person-in-charge. applicant will login and request for activity (which will be stored in table activity).
then depend on the category, person-in-charge will be assigned(will be stored in table pic with their name and
activity: `activityID`(PK), `username`, `categoryID` category: `categoryID`(PK), `categoryName` pic: `activityID`, `personincharge` (name of the pic) useraccount: `name`, `username`
personincharge in table pic and
name in table useraccount has the same value.
note 2: I will join table category and activity using
categoryID to display the
My system is going to have user log in by using
username. I want to display table of activity record of the person in charge, which means it will only shows activity that the user(the one who logged in) is in charge of.
Currently I am only able to join table category and activity and display it. Here’s what I have:
$sql = " SELECT * FROM activity a JOIN category c ON a.categoryID = c.categoryID WHERE a.username= '".$_SESSION['username']."'";
Gone through so many trial and error but still cant find the answer. Thanks for the help in advance.
the flow of my system:
user login -> user request activity -> admin will pick the person in charge of the activity (the name of the pic will be insert into pic table along with the activityID)
pic login -> pic see the list of activity that he/she has been assigned to be in charge of and take action on the request.
**the situation 2 is what i’m currently stuck on. to display only activity he/she is assigned to.