I need ideas with checbox form

0

I need to change a database when a check box is checked - going from "N" to "S", but there are several checkboxes on the page and how each record in the table has its id and option S or N I can not treat the checkboxes as an array, would someone please have an idea of how I could do it? I already have everything ready, I just need to change the options between S and N

    
asked by anonymous 30.08.2018 / 01:16

1 answer

0

Good night, my friend,

If you publish part of the code it would be easier to help you.

Logic would be something like:

$resul; //resultado do banco de dados
$opcao; // s ou n $_POST

foreach($result as $rs){ // loop com os dados do banco

if($rs['campo'] != $opcao){ // verifica se valor é diferente do que esta no banco...

update....

}

}

    
30.08.2018 / 02:29