Re: yes/no

2001-03-02 Thread Curtis Maurand


set your column something like: enum('0','1');

Curtis

On Fri, 2 Mar 2001, Scott Dunn wrote:

> I want to have like in Access a column that is yes or no or true or false,
> something on that line. I looked at www.mysql.com but could not find
> anything. I don't know what exactly I am looking for. Could someone give me
> a hand it will be greatly appreciated.
>
>
> -
> 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
>


-
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




Re: yes/no

2001-03-02 Thread Basil Hussain

Hi,

> I am trying to insert this into my table but mysql doesn't like my syntax.
> 
> alter table categoryminor solvalveyn enum('True','False');

You missed something from the query. It should be:

ALTER TABLE categoryminor ADD COLUMN solvalveyn ENUM('True', 'False');
  ^^

It helps if you tell MySQL that you want to add a column. :)

> When I press enter it does nothing it just goes to a greater than prompt.

You probably just forgot to terminate the line with a semi-colon (';') -
either that, or you mis-quoted the ENUM values and MySQL still thinks you're
in the string.

> What I want is for 1 to be true and 0 to be false.

In that case, you want:

ALTER TABLE categoryminor ADD COLUMN solvalveyn ENUM(1, 0);

However, if what you're thinking of is to have the field hold one or zero
and for it to be displayed as true/false, then you won't be able to do that.
MySQL will only return the actual value stored in the field - it doesn't
interpret anything for you. However, you could resort to some trickery with
IF() statements in the SELECT query to get this, but that could turn ugly.

Regards,


Basil Hussain ([EMAIL PROTECTED])


-
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




yes/no

2001-03-02 Thread Scott Dunn

I am trying to insert this into my table but mysql doesn't like my syntax.

alter table categoryminor solvalveyn enum('True','False');

When I press enter it does nothing it just goes to a greater than prompt.

What I want is for 1 to be true and 0 to be false. 
What is the syntax that I am needing?

-
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




Re: RE: RE: yes/no

2001-03-02 Thread

Like you, I too consider anything not 0 as true.

The cool thing about enum types is you can do it both ways (if you are simulating a 
boolean). This flexibility it affords the best of both worlds.

It gives coders the ability to deal in binary AND/OR something more english like - 
which in the long run can make for more readable, maintainable code.  

Jon Haworth <[EMAIL PROTECTED]> wrote:
>
> You certainly could, in fact you should use whatever you're happy with.
> Intuitive coding for me personally would have "anything that isn't 0" as
> true and "0" as false, if you prefer Y and N then here's a perfect solution.
> 
> Cheers
> Jon
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 02 March 2001 14:32
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: RE: yes/no
> 
> 
> Why not use an enumerated type.  It takes up almost no storage and it makes
> for more intuitive coding since you can assign Y/N to 1/0.
> 
> Jon Haworth <[EMAIL PROTECTED]> wrote:
> >
> > I usually use a tinyint with a value of 1 for true, and 0 for false. There
> > doesn't appear to be a boolean datatype in MySQL, but I may have missed it
> > :-)
> > 
> > 
> > HTH
> > Jon
> > 
> > 
> > -Original Message-
> > From: Scott Dunn [mailto:[EMAIL PROTECTED]]
> > Sent: 02 March 2001 13:55
> > To: Mysql
> > Subject: yes/no
> > 
> > 
> > I want to have like in Access a column that is yes or no or true or false,
> > something on that line. I looked at www.mysql.com but could not find
> > anything. I don't know what exactly I am looking for. Could someone give
> me
> > a hand it will be greatly appreciated.
> > 
> > 
> > -
> > 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
> > 
> > 
> > 
> > **
> > 'The information included in this Email is of a confidential nature and is
> 
> > intended only for the addressee. If you are not the intended addressee, 
> > any disclosure, copying or distribution by you is prohibited and may be 
> > unlawful. Disclosure to any party other than the addressee, whether 
> > inadvertent or otherwise is not intended to waive privilege or
> > confidentiality'
> > 
> > **
> > 
> > -
> > 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
> > 
> > 
> --
> ===
> "If you put three drops of poison into a 100 percent pure Java, you get -
> Windows. If you put a few drops of Java into Windows, you still have
> Windows."
> -- Sun Microsystems CEO, Scott McNealy
> 
> __
> Get your own FREE, personal Netscape Webmail account today at
> http://webmail.netscape.com/
> 
--
===
"If you put three drops of poison into a 100 percent pure Java, you get - Windows. If 
you put a few drops of Java into Windows, you still have Windows."
-- Sun Microsystems CEO, Scott McNealy

__
Get your own FREE, personal Netscape Webmail account today at 
http://webmail.netscape.com/

-
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




Re: yes/no

2001-03-02 Thread Basil Hussain

Hi,

> I want to have like in Access a column that is yes or no or true or false,
> something on that line. I looked at www.mysql.com but could not find
> anything. I don't know what exactly I am looking for. Could someone give me
> a hand it will be greatly appreciated.

The ENUM field type will do exactly what you want here. It isn't strictly
boolean, but will work exactly how you want if you just specify "Yes" and
"No (or "True and "False", etc.) as the possible values.

For more info, see the MySQL manual:

http://www.mysql.com/doc/E/N/ENUM.html

Regards,


Basil Hussain ([EMAIL PROTECTED])


-
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




Re: yes/no

2001-03-02 Thread MikeBlezien

On Fri, 2 Mar 2001 14:00:21 - , Jon Haworth <[EMAIL PROTECTED]>
wrote:

You can use the datatype:
col_name ENUM('True','False') # True or False
or
col_name SET('True','False') # only these value will be excepted

>>I usually use a tinyint with a value of 1 for true, and 0 for false. There
>>doesn't appear to be a boolean datatype in MySQL, but I may have missed it
>>:-)
>>
>>
>>HTH
>>Jon
>>
>>
>>-Original Message-
>>From: Scott Dunn [mailto:[EMAIL PROTECTED]]
>>Sent: 02 March 2001 13:55
>>To: Mysql
>>Subject: yes/no
>>
>>
>>I want to have like in Access a column that is yes or no or true or false,
>>something on that line. I looked at www.mysql.com but could not find
>>anything. I don't know what exactly I am looking for. Could someone give me
>>a hand it will be greatly appreciated.

Mike(mickalo)Blezien

Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225) 686-2002
=















-
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




RE: yes/no

2001-03-02 Thread Jon Haworth

I usually use a tinyint with a value of 1 for true, and 0 for false. There
doesn't appear to be a boolean datatype in MySQL, but I may have missed it
:-)


HTH
Jon


-Original Message-
From: Scott Dunn [mailto:[EMAIL PROTECTED]]
Sent: 02 March 2001 13:55
To: Mysql
Subject: yes/no


I want to have like in Access a column that is yes or no or true or false,
something on that line. I looked at www.mysql.com but could not find
anything. I don't know what exactly I am looking for. Could someone give me
a hand it will be greatly appreciated.


-
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



**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**

-
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




yes/no

2001-03-02 Thread Scott Dunn

I want to have like in Access a column that is yes or no or true or false,
something on that line. I looked at www.mysql.com but could not find
anything. I don't know what exactly I am looking for. Could someone give me
a hand it will be greatly appreciated.


-
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




Re: Get 'yes', 'no', or 'either' query ?

2001-02-06 Thread Gerald L. Clark

Floyd Baker wrote:
> 
> Hi.
> 
> Hey I have been using a query in a search with prioritized criteria.
> 
> In five different qualification fields, the first one filled in would produce
> the specific search.  Name, City, Zip, (C)enter or (I)ndividual...  If name &
> city empty and zip filled in, all that zip would appear.  No problem.
> 
> Now I have a situation where I do not want *all* zips to appear but only those
> belonging to either (C)enter *or* (I)ndividual.   That is still no problem.
> That is simple 'zip' *and* 'type'.
> 
> But now, if 'type' can be *either* (C) or (I), and we want to see *all* the
> zips, I get lost.
> 
> It seems like it should be simple but I cannot make a third option of the input
> form to look for *either* in the same query. This is to be done for 3 out of the
> 5 fields in the same input form.   I could probably do it with *lots* of
> if/thens but I'd rather not if possible otherwise.
> 
> Can someone suggest something.  Thanks much, in advance.
> 
> Floyd Baker
>

Don't include the type field in the where clause.

-
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




Get 'yes', 'no', or 'either' query ?

2001-02-05 Thread Floyd Baker



Hi.  

Hey I have been using a query in a search with prioritized criteria.  

In five different qualification fields, the first one filled in would produce
the specific search.  Name, City, Zip, (C)enter or (I)ndividual...  If name &
city empty and zip filled in, all that zip would appear.  No problem.

Now I have a situation where I do not want *all* zips to appear but only those
belonging to either (C)enter *or* (I)ndividual.   That is still no problem.
That is simple 'zip' *and* 'type'.  

But now, if 'type' can be *either* (C) or (I), and we want to see *all* the
zips, I get lost.

It seems like it should be simple but I cannot make a third option of the input
form to look for *either* in the same query. This is to be done for 3 out of the
5 fields in the same input form.   I could probably do it with *lots* of
if/thens but I'd rather not if possible otherwise.  
 
Can someone suggest something.  Thanks much, in advance.

Floyd Baker


--


-
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