From: Micheal Mc Evoy Date: March 23 1999 12:58am Subject: Re: Binary type? True/False, Yes/No, On/Off List-Archive: http://lists.mysql.com/mysql/818 Message-Id: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Enum is the best way to handle this, it's fairly descriptive in the table. CREATE TABLE table_name ( . . . contact enum('Y', 'N') DEFAULT 'N' NOT NULL . . ) Micheal On Mon, 22 Mar 1999, Daevid Vincent wrote: >Date: Mon, 22 Mar 1999 15:10:54 -0800 >From: Daevid Vincent >To: mysql@stripped >Subject: Binary type? True/False, Yes/No, On/Off > >Is there a preferred way to make a field in a SQL database that only has two >options, such as Yes/no, On/Off, True/False? > >I have a field that would equate to a checkbox on a web page. Either the person >wants to be contacted or they don't. >What is the best way to create that field in mySQL? Using a TINYINT? CHAR? ENUM? > >It seems there should be a field/data type for this kind of "flag" scenario. > >Daevid Vincent. >What is http://TheMatrix.com > > >--------------------------------------------------------------------- >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before >posting. To request this thread, e-mail mysql-thread809@stripped > >To unsubscribe, send a message to the address shown in the >List-Unsubscribe header of this message. If you cannot see it, >e-mail mysql-unsubscribe@stripped instead. > --- Micheal Mc Evoy mjmc@stripped http://www.whitepine.com WhitePine Consulting supports the Free Software Foundation and it ideals by promoting, using and supporting Open Source, GNU and GPL'd Software.