AYUDA EN UPDATE DE PHP
Publicado por Carlos (1 intervención) el 25/12/2008 19:55:41
Hola tengo este codigo la duda es que hace el update pero lo mete a la base como campos vacios porque tal vez me falta alguna condicion o que me podrian ayudar por favor:
<?php
include("../conectar.php");
$link=Conectarse();
$id=$_POST['id'];
$nombre = $_POST['nombre'];
$tipo = $_POST['tipo'];
// creamos la sentencias sql de update.....
mysql_query("Update coche Set nombre='$nombre', tipo='$tipo' where id='$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>
</body>
</html>
<?php
include("../conectar.php");
$link=Conectarse();
$id=$_POST['id'];
$nombre = $_POST['nombre'];
$tipo = $_POST['tipo'];
// creamos la sentencias sql de update.....
mysql_query("Update coche Set nombre='$nombre', tipo='$tipo' where id='$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>
</body>
</html>
Valora esta pregunta


0