Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/12/2008, 08:23
majony
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Mensajes: 421
Antigüedad: 15 años, 4 meses
Puntos: 0
Ayuda con update

Hola mi problema es que cuando realizo un update los valores anteriores los vuelve en blanco por que sucede esto les dijo mi codigo gracias ....


include("../conectar.php");
$link=Conectarse();

$id=$_POST['id'];
$nombre = $_POST['nombre'];
$tipo = $_POST['tipo'];
// creamos la sentencias sql de update.....
if (empty($_POST["id"])){

?>
<br><br>
<form name="forma11" action="cocheupdate.php" method="get">
<table border="0" align="center">
<tr>
<td>Nombre:</td>
<td><input type="text" name="nombre" size="20" maxlength="256">
</td>
</tr>
<tr>
<td>tipo</td>
<td><input type="text" name="tipo" size="20" maxlength="256">
</td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" value="listo" name="listo">
</td></tr>
</table>
</form>
<?php
mysql_query("Update coche Set nombre='$nombre', tipo='$tipo' where id='$id' ");
} else { echo "no se pudo hacer la actualizacion"; }

?>
</body>
</html>