Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/05/2009, 00:37
Avatar de spolli
spolli
 
Fecha de Ingreso: diciembre-2008
Mensajes: 68
Antigüedad: 15 años, 4 meses
Puntos: 0
problema con update sql

Hola , estoy haciendo un update y me tira este error de sql , mire un como se hace el update bien pero no funciona la modificacion

el error
Error en consulta UPDATE fede SET id='1', titulo='ggg', titulo1='gg', cuerpo='ggg', WHERE id='1':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 'WHERE id='1'' at line 1

Código PHP:
$id=$_POST['id'];
$titulo=$_POST['titulo'];
$titulo1=$_POST['titulo1'];
$cuerpo=$_POST['cuerpo'];

include(
'../../conexion.php');

$sql "UPDATE fede SET id='$id', titulo='$titulo', titulo1='$titulo1', cuerpo='$cuerpo',  WHERE id='$id'";

$result mysql_query($sql$conexion) or die("Error en consulta $sql:".mysql_error() );