in reply to mysql, checkbox, set, processing

Is your question how to create a set column in MySQL or are you actually asking how to put the data into MySQL?

BTW: Here's a piece on why you might consider using something other than a SET in MySQL.

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: mysql, checkbox, set, processing
by shemp (Deacon) on Aug 31, 2005 at 21:24 UTC
    Yes, set seems like a good idea at first glance but it WILL bite you later on. When you set up the table definition, you specify all the values that are acceptable in the set. Then when you realize you need another valid value in the set, you need to alter the table definition. And you need to keep the original set items in the same order because the storage is actually numeric aliases, and when you redefine the column, it doesnt woory about the stored values. When you want to remove a value from the set the situation is worse, because then you can't retain the same positioning of all the set elements in the definition.

    A much better solution is to use a lookup table with the valid values you'd put in the set. But you need an intermediate table to facilitate the many-to-many relation that occurs with a set.

    Similar arguements for the ENUM datatype, but easier to implement with the lookup table because there is no many-to-many relation.


    I use the most powerful debugger available: print!