Paul_M
Mon 17th Apr '06, 2:36pm
This is from my fellow admin (who doesn't have an account here):
-----------------
Dealing with user profile fields set up as Multiple Selection Menus is a major pain in the posterior!
Let's say I've set up the following such field ...
field#
selection-z
selection-9
selection-a
selection-1
One would assume this field would be defined as a SET column (http://dev.mysql.com/doc/refman/5.0/en/set.html) and the following MySQL would work ...
Code:
UPDATE forum.userfield SET field# = field# | POW(2,FIND_IN_SET('selection-a',field#)-1) WHERE ...
The expression "FIND_IN_SET('selection-a',field#)" returns 0 rather than 3, necessitating "hard coding" the MySQL ...
Code:
UPDATE forum.userfield SET field# = field# | POW(2,2) WHERE ...
Aside from having to know the relative position of each selection, if you ever change the order of the selections you'll need to go back and change all the "hard coding" http://www.mini2.com/forum/images/newsmilies/eek.gif
Can you ask the vBulletin folks how to deal with this problem?
Thanks
-----------------
Dealing with user profile fields set up as Multiple Selection Menus is a major pain in the posterior!
Let's say I've set up the following such field ...
field#
selection-z
selection-9
selection-a
selection-1
One would assume this field would be defined as a SET column (http://dev.mysql.com/doc/refman/5.0/en/set.html) and the following MySQL would work ...
Code:
UPDATE forum.userfield SET field# = field# | POW(2,FIND_IN_SET('selection-a',field#)-1) WHERE ...
The expression "FIND_IN_SET('selection-a',field#)" returns 0 rather than 3, necessitating "hard coding" the MySQL ...
Code:
UPDATE forum.userfield SET field# = field# | POW(2,2) WHERE ...
Aside from having to know the relative position of each selection, if you ever change the order of the selections you'll need to go back and change all the "hard coding" http://www.mini2.com/forum/images/newsmilies/eek.gif
Can you ask the vBulletin folks how to deal with this problem?
Thanks