I have 3 table how to get the value of 3rd table by using join in MySql
table1
RowID UserID RoleID
1 1 2
2 171 3
table2
RowID RoleID PermissionID
1 2 2
2 2 3
3 3 14
4 3 15
table3:
PermissionID PermissionName
2 Edit organisation
3 Delete organisation
14 Create group
15 Edit group
16 Delete group
Here I will know only the UserID, if suppose the UserID is 171, then I should get the roleid(3) from table1 and get PermissionID(14,15) from table 2 and then get the PermissionName(Create group, Edit group) from table 3 and I have to store it in a list. How can I do it. I am using c# and mysql. Thanks
SQL Query to select from DB:
Next step: (But use ExecuteReader() instead of ExecuteNonQuery())