Posted by xclarky on 02/05/06 15:04
ENUM is basically the same as SET however it allows NULL values.
Therefore this would be a wrong data type to use considering what you
are storing. Both basically set up a list of acceptable values for the
field.
As you are storing an array, I would advise you to convert it to a
string so you have a list of numbers, separated by a divider; as you
have done.
You can then store that list in your field, VARCHAR or TEXT should be
appropriate depending on the length of the list.
When retrieving the data you can use explode() or array_map() to create
an array of the numbers for whatever purpose you wish. Alternatively
you can use MySQL functions in the WHERE clause for statements if you
are looking to perform a action where a match is found for a specific
value in your list.
Hope that helps you.
[Back to original message]
|