0

I have this form

<tr role="row" class="odd">
<td>Category Name</td>
<td> <input type="text" value=""  class="form-control"  name="eids[<?php echo $id?>]"></td>
</tr>

And here is how i update

include "config.php";
foreach($_POST['eids'] as $key=>$value){ 
    $updateq=$conn->prepare("UPDATE  `table_name` SET table_row='$value' WHERE sn='$key'");
    $updateq->execute();
    }

When I submit let say three records ie(A,B,C) Table updated like this (C,C,C). Please help

Mamouz
  • 23
  • 7

1 Answers1

0

on this page:

PHP: Possible to automatically get all POSTed data?

i found this:

Sure. Just walk through the $_POST array:

foreach ($_POST as $key => $value) {
    echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
}
DafuQi
  • 138
  • 4