Problems writing a query to join two tables
- by Psyche
Hello,
I'm working on a script which purpose is to grant site users access to different sections of the site menu. For this I have created two tables, "menu" and "rights":
menu
- id
- section_name
rights
- id
- menu_id (references column id from menu table)
- user_id (references column id from users table)
How can a query be written in order to get all menu sections and mark the ones where a given user has access.
I'm using PHP and Postgres.
Thank you.