Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/09/2010, 12:01
Avatar de Ciberdanny
Ciberdanny
 
Fecha de Ingreso: marzo-2005
Ubicación: Distrito Federal
Mensajes: 208
Antigüedad: 20 años, 1 mes
Puntos: 1
Respuesta: Problema con Insert

ok...

lo puse asi:

<?
mysql_connect("localhost","admin","PWWW");
mysql_select_db("bdd");
$fentrega =$_POST['fentrega'];
$cpago =$_POST['cpago'];
$id =$_POST['id'];
mysql_query ("update tabla set fentrega='$fentrega', cpago='$cpago' where id=$id");
mysql_query('$cons') or die(mysql_error());
?>

y me devuelve esto:

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



Lo puse asi:

<?
mysql_connect("localhost","admin","PWWW");
mysql_select_db("bdd");
$fentrega =$_POST['fentrega'];
$cpago =$_POST['cpago'];
$id =$_POST['id'];
mysql_query ("update tabla set fentrega='$fentrega', cpago='$cpago' where id=$id");
mysql_query('$cons') or die mysql_error($cons);
?>

Y me devuelve esto:

Parse error: syntax error, unexpected T_STRING




Bueno, creo que es un error de sintaxis, pero no lo encuentro.
__________________
www.eris.com.mx