Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Type true false

  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    137
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Type true false

    Which Type should i use when i want a value of a field as true and false.
    Should i use enum or tinyint ? or anyother which is mych more suitable.

    I will be using CakePHP for development.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    tynyint/bool, See http://dev.mysql.com/doc/refman/5.0/...-overview.html
    These types are synonyms for TINYINT(1). A value of zero is considered false. Non-zero values are considered true:
    If you really need to save it as true/false string, then you might need a char/varchar, but the other one is far better.
    Last edited by abduraooft; 03-16-2009 at 09:14 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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