hope you fine and well,
i have the following form:
<form class="hidden-print" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
</tr>
</thead>
<tr>
<?php
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT * from persons";
$i=0;
foreach ($pdo->query($sql) as $row) {
echo '<tr>';
echo '<td>'. $row['id'] . '</td>';
echo'<input type="hidden" name="id[]" value="' . $row['id'] . ' ">';
echo '<td>'. $row['Name'] . '</td>';
echo'<input type="hidden" name="name[]" value="' . $row['Name'] . ' ">';
$i++;
}
Database::disconnect();
?>
</tr>
</table>
<input class="btn btn-primary" type="submit" value="Send" >
</form>
let me explain what happening here, my form is PHP_SELF so i post the data to the same page, i created a table inside the form which contains ID's and Names, i loop through the selected data and each row in the table will contain id and name of person, as you see, i defined the inputs name and id as arrays eg. name[] and id[] , and i have a submit button at the end of the form will post the arrays id[] and name[].
now what i want is to put an submit input in each row ! so when i click the submit button it will post just the id and the name of the person in this row !
is this possible ?!
regards.