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 Quote Link to comment 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'). Quote Link to comment Share on other sites More sharing options...
lordvader Posted May 9, 2008 Author Share Posted May 9, 2008 Enum is neat! Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.