Código PHP:
while ($row = mysql_fetch_row($result))
{
echo "<form method= 'POST' action= 'index.php' name= '".$row[3]."' style= 'display: inline';>";
echo "<input type='hidden' value='".$row[3]."' name='del'>";
echo "</form>";
echo "<input type='text' style='display:inline; width:100px;' value='".$row[0]."' name='nombre'> ";
echo "<input type='text' style='display:inline; width:100px;' value='".$row[1]."' name='apellido1'> ";
echo "<input type='text' style='display:inline; width:100px;' value='".$row[2]."' name='apellido2'> ";
if ( $row[4] != "")
{
echo "<input type='text' style='display:inline;width:20px;' value='".$row[4]."' name='botella'> ";
}
echo "<input type='text' style='display:inline; width:100px;' value='".$row[5]."' name='Calendario'> ";
echo "<input type='text' style='display:inline; width:100px;' value='".$row[6]."' name='correo'> ";
echo "<a href='#' onclick=\"document.forms['".$row[3]."'].submit();\"> BORRAR</a>";
echo $_POST['del'];
if ($_POST['del'] != "")
{
mysql_query("DELETE FROM listas WHERE carnet='".$_POST['del']."'") or die (mysql_error());
}
echo "<p>";
}