Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 384669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:24:11+00:00 2026-05-12T15:24:11+00:00

I’m currently working on improving my database to make room for growth. As it

  • 0

I’m currently working on improving my database to make room for growth. As it stands, different users have different ‘permissions’ to areas of the website. Some users have permissions to multiple areas of the website.

I’d like some feedback if I’m doing this in the most efficient way:

 tblUsers:
    usrID       usrFirst       usrLast       phone    //etc....
      1            John          Doe 
      2            Jane          Smith
      3            Bill          Jones          


 tblAreas: 
    id      name   
     1       Marketing
     2       Support
     3       Human Resources
     4       Media Relations

 tblPermissions:

    id       usrID       areaID   
    1          1           2
    2          1           4
    3          2           1
    4          3           3

Right now, for each “area”, I have separate directories. However, I’d like to minimize all of these directories down to one main directory, and then redirect users on logging in to their appropriate ‘area’ based upon their permissions.

Does it sound like I’m doing this correctly? I’ve never created a multi-layered site with different permissions and different groups of people, thus, I’m certainly open to learning more on how to do this correctly.

Thanks very much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:24:11+00:00Added an answer on May 12, 2026 at 3:24 pm

    The general design is ok. The issues that pop out on me relate to naming.

    • SQL doesn’t need hungarian notation — generally considered unnecessary / bad (tblUsers -> users).
    • I wouldn’t prefix table-names to column-names …
    • … except for column “id” which should always include your table name (i.e. areaId)
    • Your “first” and “last” column don’t make sense (hint: firstName)
    • I’d rename tblPermissions -> userAreas

    Depending on your programming language and database, I’d also recommend using underscore instead of capitalization for your table/column-names.

    As for using separate directories for different groups, I’d advise against it. Have the security-checks in your code instead of your directory layout.

    Reasoning:

    What happens when somebody decides that support is also allowed to do some marketing stuff? Should you change your code, or add a record into your database?

    Or what if you have overlapping actions?

    @brianpeiris: A couple of things come to mind:

    • No need for column aliases in JOINs
    • Makes it easier to search through code (“foo_id” gives less results than “id”)
    • JOIN USING (foo_id) instead of JOIN ON (foo.id=bar.id).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a reasonable size flat file database of text documents mostly saved in
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.