I get the values in the table from the database by SELECT FROM...(MySQL). This works fine, but now i want to have a delete button in each row that deletes this row from database. The problem is that the create dates all have the same name attribute
<?php $createDate = $_REQUEST['createDate'] ;
function deleteQuantityPlan($createDate) {
createConnection();
$delete_quantity_plan = "DELETE FROM andon_quantity_plan where erstelldatum = '". $createdate ."'";
$result = mysql_query($delete_quantity_plan) or die ("error");
return; }?>
HTML:
<form action="shiftenter.php" method="post">
<div class="col-lg-2" style="background-color:#E1E1E1;width:65%;border-radius:10px;float:left;margin-left:17.5%;margin-right:17.5%;margin-top:2.5%">
<h3>Taktvorgabe hinzufügen!</h3>
<div style="height:5px;"></div>
<table style="font-size:12px;" id="tabelle" class="table">
<thead>
<tr>
<th>Erstelldatum</th>
<th>Gültig von</th>
<th>Gültig bis</th>
<th>Schichtnummer</th>
<th>Stück/min</th>
<th style='float:right'>Taktvorgabe löschen</th>
</tr>
</thead>
<tbody id="table1Body">
<?php
$takttdaten = getAllQuantityPlans();
for ($i = 0; $i < sizeof($takttdaten); $i++) {
echo "<tr>";
echo "<form action='shiftenter.php' method='post'><td name='datum'>" . $takttdaten[$i]->erstelldatum . "</td>";
echo "<td>" . $takttdaten[$i]->validfrom . "</td>";
echo "<td>" . $takttdaten[$i]->validuntil . "</td>";
echo "<td>" . $takttdaten[$i]->shiftnumber . "</td>";
echo "<td>" . $takttdaten[$i]->planquantity . "</td>";
echo "<td><button style='float:right;' class='btn btn-danger' type='submit'>X</button></td></form>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<button type="submit" style="width:15%;margin-top:35px;" class="btn btn-info">
<span style="float: left;" class="glyphicon glyphicon-floppy-disk"></span>Taktvorgabe speichern!</button>
</form>
echo "<a href='javascript:send($takttdaten[$i]->id)' ...";