mysql join member roles
i need to get the members roles for specific users id


SELECT mem.`first_name`, mr.`role`
FROM member_roles mr
JOIN members mem
ON mr.`member_id`=mem.`id`
WHERE mr.`user_id` = 4


If you want the User info as well:

SELECT users.`name` AS "User Name", mem.`first_name` AS "Member First Name", mr.`role` AS "Member Role"
FROM member_roles mr
JOIN members mem
ON mr.`member_id`=mem.`id`
JOIN users 
ON mr.`user_id` = users.`id`
WHERE mr.`user_id` = 4