Re: [PHP4BETA] re:Enum type in MySQl

From: Date: Thu, 13 Jan 2000 04:04:14 +0000
Subject: Re: [PHP4BETA] re:Enum type in MySQl
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-9092@lists.php.net to get a copy of this message
Allen Lee wrote: > look at the mysql select function find_in_set(). > > An enum field only lets in the things that were planned. > once they are in, select * from table where enum_field = 'No' > will work > Thanks Allen, I am really confused now! SELECT FIND_IN_SET('N','Y,N'); will return 2 so... $details=mysql_query("SELECT * FROM table_name WHERE field_name=FIND_IN_SET('N','Y,N')"); while ( $details == '2' ) { mysql_fetch_row($details); $var1=$row[0]; $var2=$row[0]; ... } this doesn't seem to do what i would want though I need the fetch row details to point to the field_name == 'N' not the result which is 2 I basically want to grab all the rows which have the field_name == 'N' and echo them into tables, I had this working quite fine when I just manually set a char(1) to Y or N Default N but I thought a enum would be a little easier to manage and a little less problematic. Thanks, Joseph H Blythe mailto:joe.blythe@binarylogic.com.au Web Developer Binary Logic 257 Churchill Road, Prospect Adelaide, South Australia, 5034 PH:(08)83420022 FAX:(08)83420155

« previous php.version4 (#9092) next »