I need ideas with checbox form

Asked

Viewed 34 times

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 of the table has its respective id and the option S or N cannot treat checkboxes as an array, Would anyone please have an idea how to do it? I have everything ready, I just need to change the options between S and N

  • Have to [Edit] the question and add the HTML you have?

  • Okay, sorry for the delay

  • There is nothing in the HTML question.

  • The html of the question must be type Hidden :)

1 answer

0

Good night buddy,

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

The 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....

}

}

  • sorry, I don’t have access to the codes here at home, but thanks for the help, sure will help me

Browser other questions tagged

You are not signed in. Login or sign up in order to post.