Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Error using checkbox for multi-value column

Quote Reply
Error using checkbox for multi-value column
Am I doing something wrong here?

I wanted to add a column called 'Language' to the Links table. A link may have content in more than one language, so we need to store multiple values. This is how I tried to do it ...

Column Name: Language
Column Type: ENUM
Column Values: Af Ar En Fr Ge Ki Po Sp
Default: En
Form Type: CHECKBOX
Form Names: Af Ar En Fr Ge Ki Po Sp
Form Values: Afrikaans Arabic English French German Kiswahili Portguese Spanish

I can use the checkbox to insert a single value, but if I check more than one box, no values are stored in the table, and any value that is already present disppears.

Can anyone see my mistake?


Quote Reply
Re: [YoYoYoYo] Error using checkbox for multi-value column In reply to
Hi,

You can't make it an ENUM type. An ENUM type in MySQL only allows a single value (useful for single select lists). You need to make it a CHAR of at least 25 (to hold all your values joined together).

Cheers,

Alex
--
Gossamer Threads Inc.