PHP - plumerio

 
Vista:

plumerio

Publicado por manuel (1 intervención) el 25/05/2007 22:27:09
hola a todos

tengo este codigo en el index para que me muestre los registros de phpmyadmin

<?PHP
include_once("bd.php");
$conn=abrirbd();
$sql="select * from ciudades";
$rs=mysql_query($sql);
while($fila=mysql_fetch_array($rs))
{
echo"<tr>";
echo"<td>".$fila["id_ciudades"]."</td>";
echo"<td>".$fila["nombre"]."</td>";
echo"<td>".$fila["poblacion"]."</td>";
echo"<td>".$fila["circuito"]."</td>";
echo"</tr>";
}
?>

a continuacion tengo estos formularios uno el de modificar

<html>
<head>
</head>
<body>
<form method="GET" action="modificar2.php">
id_ciudades <INPUT type="text" name="id_ciudades" value="texto"/><br><br>
nombre <INPUT type="text" name="nombre" value="texto"/><br><br>
poblacion <INPUT type="text" name="poblacion" value="texto"/><br><br>
circuito <INPUT type="text" name="circuito" value="texto"/><br><br>
<INPUT type="submit" name="enviar" value="modificar"/><br><br>
<INPUT type="submit" name="enviar" value="cancelar"/><br><br>
<a href="index.php">indice</a>
</body>
</html>

y su codigo correspondiente en php -modificar2.php

<html>
<head>
<title> historia de formula 1 </title>
</head>
<body>
<?PHP
$_GET["id_ciudades"];
$_GET["nombre"];
$_GET["poblacion"];
$_GET["circuito"];
$_GET["enviar"];
if ($_GET["enviar"]=="modificar")
{
include_once("bd.php"); // incluye base de datos
$conn=abrirbd(); // abre la base de datos
$sql="update into ciudades(id_ciudades,nombre,poblacion,circuito)"; // modifica registros de la tabla
$sql.="values('".$_GET['id_ciudades']."','".$_GET['nombre']."','".$_GET['poblacion']."','".$_GET['circuito']."')";
$rs=mysql_query($sql); // ejecuta la consulta
echo mysql_error();
}
else
{
header ("location:modificar.php");
}
?>
</body>
</html>

que al ejecutarlo me da este error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'into ciudades(id_ciudades,nombre,poblacion,circuito)val ues('0','p','p','p')' at line 1

sabeis cual puede ser la solucion??
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder