We offer some bonuses for members to choose from and I want to show a popup with the bonuses they have not already selected. bonus contains info on the different bonuses, and selected_bonuses contains bonus id and the members id.
SELECT bonus.* FROM bonus
LEFT JOIN selected_bonuses
ON bonus.id = selected_bonuses.bonus_id
WHERE selected_bonuses.member_id = 'xxxx'
This will show the bonuses selected for member 'xxxx'.
SELECT bonus.* FROM bonus
LEFT JOIN selected_bonuses
ON bonus.id = selected_bonuses.bonus_id
WHERE selected_bonuses.member_id IS NULL
This show the bonuses not selected by any member. I want to show what bonuses just member 'xxxx' have not chosen.
Any suggestions?