I need your help, as I can do a set_relation_n_n using a clause where to filter data based on the information that is in another set_relation_n_n
Attached is a picture,
my relational table 1 is perfect, however the relational Table 2 need to filter users who are involved in a project (information stored in relational table 1)
mysql would look like:
SELECT project_user.id_user, user.name, user.lastname, activity.id_activity FROM user INNER JOIN project_user ON user.id_user = project_user.id_user INNER JOIN activity ON project_user.id_project = activity.id_project WHERE activity.id_project='$id_project' AND project_user.id_project = '$id_project'
The idea is that in set_relation_n_n 2 (relation table 2) show me only those who are already involved in the project to which the activity belongs