My application has two tables training and competency. A competency can have many trainings linked to it and a training can have many competency that it covers. A many to many relationship
I want to be able to create a table where I manage this relation. The table for this is below.
competency_training with fields - ct_id, ct_competency_id and ct_training_id.
I am trying to create an add page via which I would be able to do this
1. Select a competency (drop down using competency table) ct_id
2. On selecting this the value for checkbox list ct_training_id is auto filled. This I am able to do via where cause
3. A separate checkbox list created from ALL the values of table training to be able to select more values trainings.trainings_id
4. Able to add multiple values to the table ct_id
My SQL Query is below
I want to be able to create a table where I manage this relation. The table for this is below.
competency_training with fields - ct_id, ct_competency_id and ct_training_id.
I am trying to create an add page via which I would be able to do this
1. Select a competency (drop down using competency table) ct_id
2. On selecting this the value for checkbox list ct_training_id is auto filled. This I am able to do via where cause
3. A separate checkbox list created from ALL the values of table training to be able to select more values trainings.trainings_id
4. Able to add multiple values to the table ct_id
My SQL Query is below
SELECT competency_training.ct_id, competency_training.ct_competency_id, competency_training.ct_training_id, competency.competency_id, trainings.trainings_id, competency.competency_name, trainings.trainings_name FROM competency_training INNER JOIN competency ON competency_training.ct_competency_id = competency.competency_id INNER JOIN trainings ON competency_training.ct_training_id = trainings.trainings_idhttps://ibb.co/QQw6ztK