Re: Re: enum !!

From: Date: Tue, 17 Jul 2001 10:16:00 +0000
Subject: Re: Re: enum !!
Groups: php.db 
Request: Send a blank email to php-db+get-10515@lists.php.net to get a copy of this message
Your first statement will not work. It is the same thing as saying select * from test where cat = 'c'. You need to use the % in order to find all rows which may contain 'c'. -----Original Message----- From: Miles Thompson <milesthompson@ns.sympatico.ca> To: McShen <hshen@crosswinds.net>; php-db@lists.php.net <php-db@lists.php.net> Date: Monday, July 16, 2001 3:40 PM Subject: Re: [PHP-DB] Re: enum !! > >select * from test where cat like 'c' > >or, a little broader > >select *from text where cat like '%c%' > >Miles Thompson > >At 02:56 PM 7/16/01 -0400, McShen wrote: >>ok. I use set to make a table. here is my table 'test' >>+-------+------+ >>| name | cat | >>+-------+------+ >>| shen | a,c | >>| shen1 | b,c | >>+-------+------+ >> >>How can I find all records that contain 'c'? >>i tried >>select * from test where cat='c'; >> >>it returned "empty set"; >> >>please help >> >> >>"Tom Hodder" <t.hodder@globalgold.co.uk> wrote in message >>news:NOEMKHKHBPNACMAIJAPECEPMCCAA.t.hodder@globalgold.co.uk... >> > >> > First normal form (1NF), A table in which the intersection of every column >> > and record contains one, and only one, value. >> > >> > >> > >> > -----Original Message----- >> > From: Hugh Bothwell [mailto:hugh_bothwell@hotmail.com] >> > Sent: 16 July 2001 19:21 >> > To: php-db@lists.php.net >> > Subject: [PHP-DB] Re: enum !! >> > >> > >> > >> > "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. >> > >> > >> > >> > -- >> > PHP Database Mailing List (http://www.php.net/) >> > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >> > For additional commands, e-mail: php-db-help@lists.php.net >> > To contact the list administrators, e-mail: php-list-admin@lists.php.net >> > >> > >> >> >> >>-- >>PHP Database Mailing List (http://www.php.net/) >>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >>For additional commands, e-mail: php-db-help@lists.php.net >>To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >For additional commands, e-mail: php-db-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#10515) next »