ssailer Posted December 25, 2009 Share Posted December 25, 2009 I am new to PHP and am setting up a database in PHP MyAdmin. I just can't figure out what field to type to assign to a field that I want to be a checkbox on my web site. A Yes/No, True/False field. Quote Link to comment https://forums.phpfreaks.com/topic/186353-what-field-type-do-i-use-in-php-myadminmysql-for-a-checkbox-field/ Share on other sites More sharing options...
trq Posted December 25, 2009 Share Posted December 25, 2009 Probably just use a smallint then set it to default to 0. When you want to set the value to true set it to 1. Quote Link to comment https://forums.phpfreaks.com/topic/186353-what-field-type-do-i-use-in-php-myadminmysql-for-a-checkbox-field/#findComment-984095 Share on other sites More sharing options...
fenway Posted December 28, 2009 Share Posted December 28, 2009 ENUMs work too. Quote Link to comment https://forums.phpfreaks.com/topic/186353-what-field-type-do-i-use-in-php-myadminmysql-for-a-checkbox-field/#findComment-984641 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.