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 6654951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:27:13+00:00 2026-05-26T01:27:13+00:00

I am working on a project and was wondering what the best practice for

  • 0

I am working on a project and was wondering what the best practice for the following scenario would be?

I am developing an application that needs to have user access control. When the user launches the application they will be prompted for username and password. The application is designed such that users will be connecting to different databases depending on what school they are from. So, each school is going to have a different database address. So, would i ask the user for the database url at the login prompt too?

Also, how do i re-strict access to the database to only allowing that application access to the database? For instance, you can’t launch a different application and try to connect to that database with the same username and password, because it is not the correct application?

Thanks, if you need me to explain anything further, please let me know.

More Detail:

The list of schools would not be set at compile time. Schools would select to use the application and then set up a database for the use of the software and then their students would use the application. So, there would not be an initial list of schools. What would be your suggestion to solve that problem?

Each school host’s their own server.

  • 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-26T01:27:14+00:00Added an answer on May 26, 2026 at 1:27 am

    There’s no need to do a different database per school, or even a different table for that matter.

    You can just use a tables like

    school  -- all schools with data belonging to that school.
    ------------
    id integer primary key auto_increment
    name varchar(255)
    unique index idx_school (name)
    
    user -- all users from all schools in one table.
    --------
    id integer primary key auto_increment
    username varchar(255)
    passhash varchar(200)  -- hashed and salted password
    salt varchar(10)       -- salt used, not encrypted, but different per user.
    school_id integer not null foreign key references school(id)
    unique index idx_user (username, school_id)
    

    Select a user using:

    SELECT u.id FROM user u
    INNER JOIN school s ON (s.id = u.school_id)
    WHERE s.name = :schoolname
      AND u.name = :username
      AND u.passhash = SHA2(CONCAT(salt,:password),512) 
    

    The :.... are your parameters.

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

Sidebar

Related Questions

On the project I am working on I have a table that needs to
I have a working project that Im amending, it crashes after trying to use
I'm just wondering if its possible to have a Vaadin project working under google
I was wondering what the best practice is when using PHP within HTML? Would
I'm working on a ruby on rails project that requires recording some simple user
I am working on my first large project that uses EF4 and have been
I am working on an OS project and I am just wondering how a
I working on project and have problem with threading and update of UI. I
I m working on project user to move the image in one position to
I have a working C2DM project, atm. I have me and my colleagues phones

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.