Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/07/2011, 20:39
facuferrari
 
Fecha de Ingreso: mayo-2011
Mensajes: 42
Antigüedad: 13 años
Puntos: 0
Modify DB MySQL

que tal, me salta error de sintaxis mysql

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 '' at line 1.

Sabran en donde esta el error? aqui esta el codigo:


Código:
<?php
	include 'connection.php';
	
	if(!isset($_POST['submit'])){
		$q = "SELECT * FROM torneo WHERE ID = $_GET[id]";
		$result = mysql_query($q);
		$equipo = mysql_fetch_array($result);
	}else{
	
		$u = "UPDATE `test_database`.`torneo` SET `equipo` = '$_POST[equipo]',`puntaje` = '$_POST[puntaje]' WHERE ID=$_POST[id]";
		mysql_query($u) or die (mysql_error());
		
		header("Location: index.php");
	}
	
?>

<h1>Modificar equipo:</h1>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
	equipo:  <input type="text" name="equipo"  value="<?php echo $equipo['equipo'] ;?>" /> <br/>
    puntaje: <input type="text" name="puntaje" value="<?php echo $equipo['puntaje'];?>"/>
    <input type="hidden" name="id" value"<?php echo $_GET['id'] ?>" />
    <input type="submit" name="submit" value="modify" />
</form>