Errant_Shadow Posted April 15, 2009 Share Posted April 15, 2009 I'm making some database tables for a game I'm working on and I've come to be stuck on a decision. The game is based on racing cars, so I'll need to create tracks and save their data in MySQL. Now what I've got so far is an array of segments including the length of the segment, what the segment is made of (dirt, rocks, etc etc), and what hazard exists on the segment (corner, hill, etc etc). So a track is basically an array of these segments, but each track will be different. I know there has to be at least 2 segments for the most basic kind of track (an oval) but more elaborate tracks may have any number of segments... So my decision is this: do I make one database table with the track name and a maximum number of possible segments, using SET to hold the three segment variables, and allow unused segments to be null, or do I make a new table for each track, where each row contains the three elements in separate rows? (MySQL version 5.0.22, in case that makes a difference) Quote Link to comment Share on other sites More sharing options...
mandred Posted April 15, 2009 Share Posted April 15, 2009 Multiple tables, always. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.