lordvader Posted May 8, 2008 Share Posted May 8, 2008 In my rows there's an on/off field. If data for that row is to be considered "On" or enabled, then it's cell in the 'On' column gets a value of 1. If it's "off" then it gets a value of 0. Whats the best data type to store these 1's and 0's? I have it on tinyint, but even that is still too big. thanks Link to comment https://forums.phpfreaks.com/topic/104749-solved-best-data-type-to-store-a-1-or-a-0-in-a-field/ Share on other sites More sharing options...
mezise Posted May 8, 2008 Share Posted May 8, 2008 In MySQL TINYINT(1) is common way to store boolean type (BOOL, BOOLEAN are synonyms). http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html You may also use ENUM('true', 'false'). Link to comment https://forums.phpfreaks.com/topic/104749-solved-best-data-type-to-store-a-1-or-a-0-in-a-field/#findComment-536233 Share on other sites More sharing options...
lordvader Posted May 9, 2008 Author Share Posted May 9, 2008 Enum is neat! Thanks Link to comment https://forums.phpfreaks.com/topic/104749-solved-best-data-type-to-store-a-1-or-a-0-in-a-field/#findComment-537176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.