I need your help to figure out how to make a query.
My idea was to build a credit system to reward users.
The administrator enters the description of credits (e.g., user is subscribed to the newsletter, he had post at least 10 comments…).
I have 3 tables:
- users (id and name),
- rewards (id and description),
- rewards_users (id_reward, id_user).
I would pull out a summary html table whose rows are formed by the user’s name and a Y or an N depending on whether there is a relationship between the user and the reward.
use the following query to show all of the rewards for a specific user
and use it as a sub query to get the users details too
e.g:
Note: not tested.