mardi 14 mars 2017

Using a checkbox's dynamic value to store in database [duplicate]

This question already has an answer here:

An SQL query returns id associated with a product. Using these results a checkbox is created for each result. e.g. <input type="checkbox" name="Apply[]" value="$row["id"]">. Here $row["id"] is id of each product returned by query. What i want is to select some checkboxes and then clicking on submit button should store the value of selected checkbox in database.

I tried using arrays as mentioned by some users for storing dynamic values but it stores only 0 as a result irrespective of whatever i select.

Is there a possible way to do this via PHP and HTML only or can this be done by GET or POST method ?




Aucun commentaire:

Enregistrer un commentaire