Checkbox field

In the Survival WordPress Plugin, the score table includes a Boolean field. This field is defined as tinyint(1) in the table. However, the usage of this field is not automatically managed by a WordPress plugin.

To display a boolean value in HTML, it’s essential to convert the data.

$checked = ($score->joker==1)? "checked": '';

echo "<input type='checkbox' name='joker' id='joker' $checked>";

And to store the boolean value, a conversion of the value is needed.

$joker = (int)isset($_POST['joker'])? 1: 0;