jeudi 18 août 2016

how to input array into database

I have a table showing a list that has multiple check boxes. One of the columns say "document title". It's a text box. When you click on more than one check box, it currently grabs the id's since the value of the checkbox has inside it. What I need to happen is, when you type something new in that textbox, lets say you update a few of them, and checkmark them, and then press an edit button, i need it to update all those updated textbox values at once.

So far, I'm only able to get it to display all the id's from the checkbox. Hope i'm making sense.

Here is the code that grabs the id's from the multiple checkbox:

if(isset($_POST['edit-documents'])) {

$checkbox = $_POST['checkbox'];
$countCheck = count($_POST['checkbox']);


for($i=0;$i<$countCheck;$i++) {

    $doc_id = $checkbox[$i];

    echo '<br>doc_id:' .$doc_id; 

}




Aucun commentaire:

Enregistrer un commentaire