Need help with merging or joining to get values
Posted on 2012-03-16
Here's what I'm doing, I'm assigning users of my site permissions to admin certain pages on a user by user basis. The way I'm doing it is by page id numbers. For instance, to approve new members, the page number is "20". In my user table, I implode all the page numbers that the user can admin and put them in to a field called "permissions_allowed". So if joe blow can admin the approval section and the renewal sections, his permissions are 20#44.
I have another table that contains all of my pages on the site.
When I display what users have what admin rights, instead of it showing as:
joe blow = 20#44
I would like it to show as
joe blow = Member approvals, member renewals
I have already dumped the permissions in to an array and have no problem displaying the numbers, I just need the best way to match the numbers with the pages so I can display the pages.
Maybe a IF or Switch statement? Would it be better to join the tables when I'm querying? What do you all think?