m... hay algo mal xq al darle modificar borra todo y deja telefono en "0" tambien
Código PHP:
<html>
<body>
<?php
include"conexion.php";
$id=$_POST['id'];
$result=mysql_query("select * from clientesl2",$conexion);
while ($row=mysql_fetch_array($result)) {
?>
<form name="clientesl2" action="action-actualizar.php" method="POST">
<input type="hidden" name="id" value="<?php echo $row[0]?>" />
<TABLE BORDER="0" align="center">
<TR><tbody><thead><tfoot>
<TH>E-Mail:</TH>
<TH>Teléfono:</TH>
<TH>Opción:</TH>
<TH>Selección</TH>
<TH>Mensaje:</TH>
</TR>
<TR>
<TD><?php echo $row[5]?></TD>
<TD><?php echo $row[4]?></TD>
<TD><?php echo $row[3]?></TD>
<TD><?php echo $row[2]?></TD>
<TD><?php echo $row[1]?></TD>
</tfoot></thead></tbody></TR>
</TABLE>
<p align="center">
<input name="enviar" type="submit" value="Modificar">
</p>
<p align="center">
<?php
}
?>
<p align="center"><a href="borrar.php?id=<?php echo $row[0]?>"><button>borrar</button>
</a>
<hr>
</body>
</html>
Código PHP:
<?php
include "conexion.php";
$id=$_POST['id'];
if ($id) {
if ($id="" or $email="" or $telefono="" or $opcion="" or $seleccion="" or $mensaje="") {
echo"mal";
}else
{
$apellido;
$query="UPDATE clientesl2 set email='{$_POST['email']}',telefono='{$_POST['telefono']}',opcion='{$_POST['opcion']}',seleccion='{$_POST['seleccion']}',mensaje='{$_POST['mensaje']}' WHERE ID='".$_POST['id']."'";
$result=mysql_query($query);
}
}
?>
en fin, tengo q tener en filas todos datos q toy pidiendo y ademas a lo ultimo tngo q tener boton modificar y borrar...pero me pierdo y rekiero de l aorientacion de profesionales como ustedes :D
Gracias de antemano