user - id, name, designation
role - id, name
user_role - id, user_id, role_id
Result
1 | John | Manager | Admin, User
2 | Peter | HR | Admin
I am able to populate the result shown above based on your script.
I am also able to update the name and designation of the users tables but not able to update the user_role tables. Kindly advice me on how to fix this issue?