January 23rd, 2014, 08:33 AM
Which datatype is used for checkbox
I am building my 1st MySQL database and have 1 question:
1) If I want to have a checkbox linked to a field in a table, what Data Type do I set for that field?
Thanks and Regards
January 23rd, 2014, 10:29 AM
i would use CHAR(1) because it's portable to other database systems (i.e. it's non-proprietary, unlike, say, ENUM)
January 23rd, 2014, 11:33 PM
Yikes, the spawn of the devil!
Originally Posted by r937
If the checkbox is yes/no, what about tinyint?
January 23rd, 2014, 11:38 PM
TINYINT is okay, except it isn't quite as portable as CHAR