Boolean variable in mysql database
Posted on 2012-04-06
i created a game in php, i want to give each kind of unit in the game some attribute..
tank is ground unit and he can attack only ground units.
helicopter is air unit and he can attack ground and air units.
so i create the database witch contains all the information about the units.
my question is witch variable i should use to save that unique attribute.(tinyint, bit, varchar, enum)
my idea was to take bit variable for each attribute(attack_air: 0/1, attack_ground: 0/1) because bit take the smallest part in the memory. varchar is way to much. tinyint might be the solution.
but i want to create it in the very best way that possible.
thanks ahead :)