Results 1 to 2 of 2

Thread: Yes/No in the table

  1. #1
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default Yes/No in the table

    I have several Yes/No fields ( they are truely Yes/No with No being the defaul value ).

    What is the correct way to code the value in the table. Yes/No or 1/0?
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    There's no boolean (0 and 1) type in mysql. You can use char(1) type to handle it. It will allow you to write single character in that field.

    What is the correct way to code the value in the table. Yes/No or 1/0?
    Do you to insert into table?

    say you have table structure like this:
    table name config
    name varchar(50)
    value char(1)


    Then your query to insert:

    INSERT INTO data (name, value) VALUES ('visible',0)

Similar Threads

  1. Image Add to Catagory Table
    By ezykiwi in forum v5.x
    Replies: 2
    Last Post: 07-13-2004, 08:00 PM
  2. Newbie: INDEX.html table width?
    By cinenganos in forum v5.x
    Replies: 2
    Last Post: 04-01-2004, 02:21 PM
  3. Table colours
    By Kamran in forum v5.x
    Replies: 8
    Last Post: 03-18-2004, 03:17 PM
  4. Adding fields to the review table
    By esm in forum v5.x
    Replies: 8
    Last Post: 07-08-2003, 08:33 AM
  5. Replies: 15
    Last Post: 12-22-2001, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •