Tengo un problemita, quiero actualizar campos en una base guardada, y lo malo es que no da errores pero no actuliza nada. el codigo del Submit se ejecuta con el boton "modificar"
Please F1
Saludos y felices fiestas
Código:
este el codigo PHPCREATE TABLE `input_fw` ( `in_id` int(11) NOT NULL auto_increment, `in_target` varchar(30) default NULL, `in_protocol` varchar(3) default NULL, `in_source` varchar(30) default NULL, `in_destiny` varchar(30) default NULL, `in_port` int(11) default NULL, PRIMARY KEY (`in_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<?
if (!$_POST['modificar'])
{
?>
<form>
<input type="hidden" name="sessid" />
<input type="hidden" name="sis_usr" />
<?
$link = mysql_connect("localhost","root","123");
?>
<table border="0" align="center">
<tr>
<td>IP</td>
<td>Destino</td>
<td>Politica</td>
<td>Protocolo</td>
<td>Puerto</td>
</tr>
<?
mysql_select_db("fw_elsan",$link);
$result = mysql_query("select * from INPUT_FW",$link);
while ($myrow = mysql_fetch_array(($result)))
{
?>
<tr>
<td><input name="in_origen" type="text" value="<? echo $myrow["in_source"] ?>"</td>
<td> <select name="in_destino" >
<option >Seleccione</option>
<option >Destino Uno</option>
<option >Destino Dos</option>
<option >Destino Tres</option>
</select></td>
<td><select name="in_politica" >
<option >Seleccione</option>
<option >Politica Uno</option>
<option >Politica Dos</option>
<option >Politica Tres</option>
</select></td>
<td><select name="in_protocolo" >
<option >Seleccione</option>
<option >Protocolo Uno</option>
<option >Protocolo Dos</option>
<option >Protocolo Tres</option>
</select></td>
<td><select name="in_puerto" >
<option >Seleccione</option>
<option >555</option>
<option >666</option>
<option >777</option>
</select></td>
<td><input type="submit" name="modificar" value ="Modificar" </td>
<td><input type="button" name="borra" value ="Eliminar" </td>
<td></td><?
}
?>
</tr></table></form>
<?
}
else
{
$link = mysql_connect("localhost","root","123");
mysql_select_db("fw_elsan",$link);
$sql = "update INPUT_FW set in_protocol ='$in_protocolo',in_destiny = '$in_destino',in_target = '$in_politica',in_port = '$in_puerto' where in_source='$in_origen'";
mysql_query($sql,$link);
//echo "<meta http-equiv=refresh content=0;url=confirmacion.php? />";
}
?>
</body>
</html>