I have a site that I'm doing in PHP, just that I have a question.
I have some while cycles and add buttons only on the button I have
while($row=mysqli_fetch_array($result))
{
$id = $row["ID"];
$Auditor = $row["Auditor"];
$auditoria = $row["Auditoria"];
$Fdeseada = $row["Fdeseada"];
$Flimite = $row["Flimite"];
echo "<tr>
<td align='right' class='estilo1'> $id </td>
<td class='estilo1'> $Auditor </td>
<td class='estilo1'> $auditoria </td>
<td class='estilo1'> $Fdeseada </td>
<td class='estilo1'> $Flimite </td>
<td class='estilo1'> $row[Estado] </td>
<td class='estilo1'><A HREF='verEncuesta.php'> Realizar </A></td>
<td><input type='submit' name='borrar' class='submit' value =".$id."></td>
</tr>";
}
echo "</table>";
that sends me the id to another php file that does the deletion of the line only that my button appears deleted + the ID number and I just want it to say Delete but if I put it Delete it does not delete me because it does not I pass the ID. How can I improve this part?
file delete
if ($_POST["borrar"]) {
$id = $_POST["borrar"];
$query = "Delete From tareas Where ID='$id'";
if ($conexion->query($query) === TRUE) {
echo "<br />" . "<h2>" . "Tarea eliminada Exitosamente!" . "</h2>";
echo "<h5>" . "<a href='calendario.php'>Regresar</a>" . "</h5>";
}
else {
echo "Error al crear el empreado." . $query . "<br>" . $conexion->error;
}
}