Log in

View Full Version : Parsing userfields


Leela
03-17-2005, 01:59 PM
I have a multiselect checkbox userfield on my board and I would like to parse this info.
I can see the serialized data in the profilefield table, however the data in userfield pertaining to my user is only 3 digits long.

For example:
SELECT `field5` FROM `vb3_userfield` WHERE userid =2
returns 380 even though I've selected about 7 options.

How does VB return the remainder of the values in the list?

Leela
03-19-2005, 08:24 AM
Anyone know how this works? I'm completely at a loss :(

Leela
03-25-2005, 09:04 AM
Blimey, I thought that someone would be able to tell me how this is calculated! I'd be grateful for a response or any suggestions as to where I can find the answer.

Marco van Herwaarden
03-25-2005, 09:24 AM
The selected options are stored as a bitfield.

Example with 4 options

Option
4 3 2 1
Value
0 1 0 1 (stored as decimal 5)
Value
1 0 0 0 (stored as decimal 8)

Leela
03-26-2005, 11:59 AM
Thanks Marco, that's helped me enormously :D