pagina del formulario:
Código PHP:
<form name="form2" method="post" action="gastos3.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#E0DFE3">
<td colspan="2"><div align="left" class="Estilo6">Enero</div></td>
</tr>
<tr>
<td><div align="left">
<?php
$result=mysql_query(
"select * from enero order by id",
$conexion
);
echo '<select name="select">';
//mostramos bd en el menu
while ($datos=mysql_fetch_array($result)){
echo '<option value=".$datos[id].">'.$datos[id].'</option>';
}
echo '</select>';
?>
</div></td>
<td><div align="left">
<input name="bt1" type="submit" id="bt1" value="Borrar">
</div></td>
</tr>
</table>
</form>
Código PHP:
$id=$_POST['id'];
if($_POST[bt1]){
mysql_query("DELETE FROM enero WHERE id=$id ",
$conexion);
Por mucho que he buscado es que no encuentro el fallo, a ver si alguien da con el por q me tiene loca ya:(
}