title: Basic MYSQL/PHP Event Registration (Database Relationships)
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>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):
  <img src="https://i.stack.imgur.com/ePgsr.png" alt="Front End"></p>
  
  <p>I have the backend working to create a new training session on POST:</p>
  
  <pre><code>&lt;?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");
  </code></pre>
  
  <p>?></p>
  
  <p>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.</p>
  
  <p>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!</p>