I am working on a simple multiplayer game that may have 2 to 6 people in a game at a time. The game is only slightly more complex than Five-Card Draw poker so it isn't very resource intensive.
In order to make the development fast and easy I am thinking about having a table like this: (simplified)
games
id (int) primary-key auto-inc > unique id
data (text) > for storing a JSON string
Here is what I'm thinking for the process:
- AJAX post includes
game_id
field - Do some permissions checking and validation
- I fetch the entry from
games
with theid
equal togame_id
- json_decode the
data
field - More permissions and validation stuff
- If changes to the game data are made: json_encode the new data and update the DB
Question: What pitfalls may I encounter doing this?