Data type for checkboxes in php

What should be the data type that will be entered in phpmyadmin if I plan to use the checkbox as input?

+3
source share
2 answers

The MySQL documentation recommends using tinyint (1) for boolean values, so tinyint (1) is probably the best.

http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

+3
source

If you have a set of related flags that you want to keep in a single column, you can also consider a SET data type that is similar to ENUM, since you can have names for each of your “options”, but SETS allows you to have several selected named parameters.

+1

Source: https://habr.com/ru/post/1730668/


All Articles