I've decided on enum. Should work fine. I've used it before and it works fine 
with PHP.

Thanks for everyone help,

Jord

On Tuesday 02 October 2001 12:13, you wrote:
> >If I wanted to define a table to have a cloumn which is either yes or no
> > for example. Would it be better to use a single char (0 or 1), or can I
> > use an enum (I find them more friendly ;)).
>
> Since enums are internaly stored as numbers, and are therefore fast,
> it's better to use them than characters. Unless ther's a specific need.
>
> It, for instance, depends on how you're gonna use them in case you
> select them. For example, if you have enum('yes','no'), and you select
> it in perl, using them in if statements like this:
>
> if ($sqlref->[0][0]) {
>   do something;
> }
>
> wont work, since, when selected in string context, you're gonna get
> 'yes', which is true (it will work if one selects it in integer
> context). But using characters '0' and '1' will always work, string '0'
> is false in perl.

-- 
Jordan Elver
Web Developer
The InternetOne UK Ltd

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to