I am posting this doubt already as a last resort. I want to insert 0 or 1 into the Boolean / TINYINT. I used var_dump and I see that html always passes as False (0).
I will post part of the code of html, php and mysql. Any help will be much appreciated!
<td><input name="input_servicos[0]" id="input_servicos[0]" type="checkbox" value="1" />Acolhimento</td>
<td><input name="input_servicos[1]" id="input_servicos[1]" type="checkbox" value="1" />Atrium</td>
<td><input name="input_servicos[2]" id="input_servicos[2]" type="checkbox" value="1" />Bar</td>
if ((isset($input_servicos[0])) || (isset($input_servicos[1]))) {
if (isset($input_servicos[0])) {
$input = $_POST[$input_servicos[0]];
$sql_input = "INSERT INTO `gestao_voluntarios`.`voluntarios` (servico_acolhimento) VALUES ('$input')";
$conn->query($sql_input);
}
}
On Html I have 36 indexes, so on php I have the too, I havent posted all the code since its pretty much the same.
Remember, the vars is boolean.
Best Regards, Helder