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

  • SEARCH
  • Home
  • 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 973109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:13:48+00:00 2026-05-16T03:13:48+00:00

I plan to use two tables (i.e. guest and employee) to control which page

  • 0

I plan to use two tables (i.e. guest and employee) to control which page is available to which user.

The guess can sign up for an account while the employee cannot. The account of an employee can only be assigned by a system administrator.

Here is the question I just found:

Assume UserA is a employee and has ‘login001’ as user name and ‘password’ as password.

Now, a guess comes to the website and applies for a user name with ‘login001’ and ‘password’ as password.

Then the userB can access some internal websites b/c he/she chose the same username/password as one of the employee does.

Here is my fix to this problem:

Method one:
Whenever a user name is applied (not matter guess or employee), the both table guess and employee should be checked to make sure there is no duplicate.

Method two:
Combine guess and employee tables together as person table. However, for guess, the user_type can be assigned as GUEST and for employee, the user_type can be assigned as EMPLOYEE.

I don’t know whether above methods make sense or not. If neither or them are good solutions, please give me some direction so that I can adopt some best practice.

I am NOT using any framework or OOP to implement my PHP script.

Thank you

  • 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-16T03:13:49+00:00Added an answer on May 16, 2026 at 3:13 am

    I would recommend you combine your two credential tables into 1. Then you can create a guest and employee table with a reference to the credential table. This way you can store additional information about the two.

    However, you may want to ask yourself what the difference between an guest and an employee is. If the only difference is access control, you may be able to get away with an additional column in the credential table that defines whether the record is a guest record or an employee record.

    Finally, once you have combined your credentials into 1 table, you should put a unique constraint on your username column. This will ensure that only 1 account can have a username like login001 or joeshmoe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web app for which I plan to use InnoDB. However
I want to generate unique and random numbers or IDs which I can use
I plan to use PyInstaller to create a stand-alone python executable. PythonInstaller comes with
I plan to use a distributed cache in my load-balanced webapp. So I'm going
If I plan to use data caching do I have to worry about conflicts
If you do not plan to use lazy loading, should deferred loading be explicity
If I do a query (I plan to use SDS.P) against the global catalog,
I have a constant value that I only plan to use once in my
I'm looking for a a mouseover sound script (for button). I plan to use
I am using mod_perl for my web application. Currently, I plan to use a

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.