Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/01/2012, 06:13
nobo
 
Fecha de Ingreso: diciembre-2011
Mensajes: 151
Antigüedad: 12 años, 4 meses
Puntos: 1
Error al introducir textarea en mysql...

EDITO: Hice un echo $insertSQL y me salio esto:

INSERT INTO tblcompra (strIndicaciones) VALUES ('Prueba20') WHERE idCompra=4You 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 idCompra=4' at line 1

Parece ser correcto...


Hola, estoy intentando enviar los datos de un textarea a una celda concreta de la base de datos... Pero creo que la consulta esta mal hecha...

La tengo asi:

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "indicaciones")) {
$insertSQL = sprintf("INSERT INTO tblcompra (strIndicaciones) VALUES (%s) WHERE idCompra=%s",
GetSQLValueString($_POST['indicaciones'], "text"),
GetSQLValueString($_SESSION['compractiva'], "int"));
El 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 'WHERE idCompra=2' at line 1

Gracias de antemano !! ;)

Última edición por nobo; 23/01/2012 a las 06:31