Forum Moderators: open

Message Too Old, No Replies

Simple Question: MySQL's tinyint format, which one is Yes (0 or 1)?

         

cosmoyoda

12:12 am on Mar 24, 2008 (gmt 0)

10+ Year Member



This is a pretty simple question.

I have a table in my database and many fields set as tinyint's. The reason why I need a tinyint is because that will work as a boolean, true or false. I need to use them as checkboxes later on.

My question is which value is Yes and which one is No? Thank you.

Demaestro

2:29 am on Mar 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Always in programming, 1 is yes and 0 is no. Always.

cosmoyoda

2:38 am on Mar 24, 2008 (gmt 0)

10+ Year Member



I will ALWAYS remember that. Thank you.

Demaestro

2:47 am on Mar 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



;) Cool... quoting my teacher there and as you can tell I always remembered what he said.

jtara

5:32 am on Mar 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The reason why I need a tinyint is because that will work as a boolean, true or false.

True.

My question is which value is Yes and which one is No?

zero is no/false. non-zero (NOT one) is yes/true.

But please declare these BOOL or BOOLEAN, (currently an alias for TINYINT, but promised as a unique data type some time in the future)