title: How to store list in MYSQL database
body: <p>I am creating a game that has a few tables.</p>
  
  <p>They are as follows</p>
  
  <p><strong>Users</strong></p>
  
  <p>user_id text</p>
  
  <p>session_id text</p>
  
  <p>last_login datetime</p>
  
  <p><strong>Sessions</strong></p>
  
  <p>session_id text</p>
  
  <p>users text</p>
  
  <p>categories text</p>
  
  <p><strong>Categories</strong></p>
  
  <p>category_id int</p>
  
  <p>category_name text</p>
  
  <hr>
  
  <p>My main problem is how to store the categories column in the sessions table. Each session is an instance of a game, and the categories are the categories of the game selected by the users. I figured I could just have a list of the category_ids that are in that session? I have the same problem with storing the users that are in a session.</p>
  
  <p>Can someone help me with a better way of doing this please?</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>user_id will be a uuid. e.g. "bcb4a209-3d90-4fe4-b8ed-594976a7b836"</p>
  
  <p>last_login is just when they logged in last so it'll be date and time</p>
  
  <p>session_id will be an 8 character alphanumeric ID such as "9KAN4P2X"</p>
  
  <p>as it stands, my idea for users would be a list of user_ids, such as "bcb4a209-3d90-4fe4-b8ed-594976a7b836, 5a8b0148-f02b-4372-9ff7-781546b5c62d"</p>
  
  <p>category_id would be an integer, e.g. 32</p>
  
  <p>category_name is just a string identifying the category, e.g. "Food"</p>
  
  <p>categories would be a list of category_ids, e.g. 32, 42, 15</p>
  
  <p>The problem is that I believe it's not advised to store lists like I suggested for users and categories, so I'm wondering how else I should do this.</p>