I'm knee deep in a multiplayer game and found out I'm doing some frowned-upon actions with MySQL (I'm a beginner with databasing and PHP).
I've got a table of users with all their pertinent information and a table for games with most of their relevant information. My problem is that I'm dynamically creating a table for each game containing a user id, their score, and other game-specific data. I know that's bad practice, so I'm looking to merge that with the single entry in my games table, but I can't figure out how to do it because of a few issues:
- Each game can have 3-6 players, so I think I'd have to assume the max and just not fill the entries?
- Players should be able to enter multiple games, so just having an "active_game" column in the users table wouldn't work
I've been looking for resources, but the best I could find is that it's also bad practice to include a "pseudo-array" in a column. Meaning if I did have an "active_games" column, it wouldn't be best practice to have the data be a CSV of all currently active game_ids.
Any help would be greatly appreciated!