Question about IDs
#5

Alright.

Imagine a Database structure. (Skipping details.)

ID INT;
PlayerName VARCHAR;
PlayerWeapon1 INT;
PlayerWeapon2 INT;
PlayerWeapon3 INT;

Instead of that, so there isn't many rows, I can have:

ID INT;
PlayerName VARCHAR;
PlayerWeapon INT;

Create new combinations IDs such as:
Weapon 1 = 1
Weapon 2 = 2
Weapon 3 = 4

Then to save Weapon 1, Weapon 2, Weapon 3 I save it into the database as ID 7 (1 + 2 + 4 = 7).

But when I load the ID of the weapon, I want to give them the correct weapon, so I need to check if Weapon 2 is in that variable.

I've seen this done before I'm not really sure where, I understand it, it's like binary.
Reply


Messages In This Thread
Question about IDs - by Kreatyve - 09.09.2013, 22:28
Re: Question about IDs - by Pottus - 09.09.2013, 22:38
Re: Question about IDs - by Kreatyve - 09.09.2013, 22:39
Re: Question about IDs - by Pottus - 09.09.2013, 22:41
Re: Question about IDs - by Kreatyve - 09.09.2013, 22:48
Re: Question about IDs - by Vince - 10.09.2013, 00:00
Re: Question about IDs - by Kreatyve - 10.09.2013, 02:51

Forum Jump:


Users browsing this thread: 2 Guest(s)