Re: [PHP4BETA] re:Enum type in MySQl
| From: | Allen Lee | Date: | Thu, 13 Jan 2000 01:39:08 +0000 |
| Subject: | Re: [PHP4BETA] re:Enum type in MySQl | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-9090@lists.php.net to get a copy of this message | ||
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
On Thu, 13 Jan 2000, Joseph H Blythe wrote:
> Hi all,
>
> I got a question about the enum type in mysql, I have set up
> a row that basically is enum('Y','N') Default N now I want to be able
> to Select from ... where ... = ... and this is where I am confused how
> do I specify an enum value, I have tried:
>
> mysql_query("SELECT * FROM .......... WHERE ......... ='N' AND
> ......... ='N');
>
> and also
>
> mysql_query("SELECT * FROM .......... WHERE ......... ='2' AND
> ......... ='2');
>
> of course the ..... are the name of the table and the enum type rows.
>
> My understanding of this is that the enum value would be "0" ,"1"
> ,"2"
>
> 0 = NULL
> 1 = Y
> 2 = N
>
> its going to be some array like thingy i suppose.
>
> Any help would be much appreciated as I have searched through the PHP
> and MYSQL docs and didn't find any examples of the enum type in action.
>
> bye for now
>
> 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
>
>
>
>
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>