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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:45:15+00:00 2026-06-11T22:45:15+00:00

I am relatively new to to database relationships, and I would love some advice

  • 0

I am relatively new to to database relationships, and I would love some advice on setting up my database for a basic registration for sessions.

GOAL:
Post a new session that people can sign up for. Maximum of 8 people per session. Admin side can see those who have signed up.

Here is what I currently have from a front end (the signup box at the bottom is just there temporarily as I work with this):
Front End

I have the backend working to create a new training session on POST:

<?php 

session_start();
include ('global/db/connection.php');
$session_name = $_POST['session_name'];
$session_description = $_POST['session_description'];
$session_date = $_POST['session_date'];

$result=MYSQL_QUERY("INSERT INTO trainingsessions (id,session_name,session_description,session_date,session_open_slots,session_booked_slots)".
   "VALUES ('NULL', '$session_name', '$session_description', '$session_date', '8', '0')");

header("location: admin.php");

?>

I also have been able to query the table and display the results in the table above. What I am trying to figure out is what sort of relationship and tables I need to create between the users and then displaying the appropriate amount of slots that are still open.

Very basic, nothing fancy at the moment. Just trying to get some fundamentals in with not luck thru other searches. Hope this makes sense, and thanks for your help!

  • 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-06-11T22:45:16+00:00Added an answer on June 11, 2026 at 10:45 pm

    You will have a many to many relationship between users and sessions (presumably). In essence each user could be assigned to many sessions, and each session will have multiple users. For that reason, you need an intersecting table that creates a composite key (the primary key is defined by multiple fields). For example, I would make the following tables:

    Table: user
    Columns: ID (primary key), Username, email
    
    Table: sessions
     columns: ID (primary Key), Name, Description, Date
    
    Table: user_sessions
    columns: user_id, session_id
    

    Using this structure, users can have multiple sessions and sessions can have multiple users.

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

Sidebar

Related Questions

Relatively new to using database and for some reason I can't get this 'execute'
I am relatively new to .Net and the database side of it in particular.
i'm relatively new to php and mysql and would like to know how to
I'm relatively new to .NET and MVC3. I'm having some trouble with the above
I am relatively new to columnar database, please forgive ignorance. Lets say I have
I am relatively new to database design so I am still learning a lot.
I am relatively new to using SQLite on Android. I have some experience with
I'm relatively new to Entity Framework. I created a database with two tables: Accounts
As this question is sure to reveal, I'm relatively new to database design. Please
Being relatively new to javascript, AJAX and jQuery, I want to post 3 values

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.