Log in

View Full Version : Checkbox Profile Fields


Adrian Schneider
07-02-2005, 02:19 AM
[vb 3.0.7]
How do these work exactly? I can't seem to figure out the relationship between what you select and the data in the db. Can someone point me in the right direction?

Reeve of shinra
07-02-2005, 03:09 AM
if its like the select box in anyway, it puts a # in the database that corresponds to your choices. So choice a would be 1, choice b would be 2 and so on.

Adrian Schneider
07-02-2005, 07:48 PM
I don't think it is because I still can't see any relationship. :)

Counterstrike
Diablo
Diablo II
Starcraft *
Starcraft: BW *
Warcraft I *
Warcraft II *
Warcraft III *
Warcraft III: FC *

* represents being checked

In the database it shows: "504"

Andreas
07-02-2005, 08:05 PM
Well ...
Well, its just binary arithmetics :)


Counterstrike 2^0 = 1
Diablo 2^1 = 2
Diablo II 2^2 = 4
Starcraft * 2^3 = 8
Starcraft: BW * 2^4 = 16
Warcraft I * 2^5 = 32
Warcraft II * 2^6 = 64
Warcraft III * 2^7 = 128
Warcraft III: FC * 2^8 = 256

Now sum up the values for all selected entries: 8+16+32+64+128+256=504 :)

Adrian Schneider
07-02-2005, 08:05 PM
Thank you sir. :)