Small problem
#4

One rule that you should keep in mind is: columns should never* have a number in their name. If they have then the database model is wrong. And contrary to what MBilal says above you need to make rows, not columns. If one vehicle is owned by one player, and one player only then the table, separate from that of the player one, should look somewhat like:

id ownedBy model x y z
1 5 411 1247.12 -147.31 12.02
7 NULL 500 2487.97 1578.56 13.57
8 1 562 -2478.86 -2047.12 25.36
where ownedBy is linked to a specific player. So if you have a player entry somewhat like this:

id name rank
1 Bob 5
Then you know that vehicle 8 is owned by Bob, because Bob has id 1.

*There are certain exceptions, but they are few. Doing something like color1 and color2 for car colors is fine, but I can't think of anything else right now.
Reply


Messages In This Thread
Small problem - by StR_MaRy - 01.12.2015, 20:52
Re: Small problem - by CmZxC - 01.12.2015, 21:03
Re: Small problem - by MBilal - 01.12.2015, 22:22
Re: Small problem - by Vince - 01.12.2015, 23:11

Forum Jump:


Users browsing this thread: 1 Guest(s)