Re: enum !!
| From: | Hugh Bothwell | Date: | Mon, 16 Jul 2001 18:21:10 +0000 |
| Subject: | Re: enum !! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-10457@lists.php.net to get a copy of this message | ||
"McShen" <hshen@crosswinds.net> wrote in message
news:20010716174257.47906.qmail@pb1.pair.com...
> how do i store multiple data in one field?
> i have a table like this
>
> +-------+-------------------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +-------+-------------------+------+-----+---------+-------+
> | test | enum('a','b','c') | YES | | NULL | |
> +-------+-------------------+------+-----+---------+-------+
>
> insert into test values('a','b','c'); doens't work. please
> help
Your query is mixed up; 'test' is the field name, not the table name, and I
think you want to put the values into three separate records, not one...
Try
INSERT INTO tablename ( test ) VALUES ( 'a' ), ( 'b'), ('c'),
('');
This should get you four records, with 'test' values of a, b, c, and null.
If you want to store more than one value in the same record, you should be
looking at sets, not enums.