jeudi 6 octobre 2016

PHP, MYSQL array from form checkboxes into variables

Im creating a form which has multiple checkboxes based on a sql query so the results values are usually always different

<input type="checkbox" name="warrior[]" value="<? echo $warrior_id; ?>">

but i dont know how to take the values of the boxes that the user has checked from the array. Each checkbox has the id of a row in my database.

I need to run each id that is checked in another query to bring up more details i need for the rest of the script.

"SELECT col1, col2 FROM table WHERE id='$????'"

There is up to 10 values in the array (up to 10 checkboxes)

Thank you for any advise




Aucun commentaire:

Enregistrer un commentaire