INSERT INTO especificaciones (especificacion, descripcion, tipo, r_progress, r_hd, recepcion, envio, revision1, envio_revision1, rec_adec, envio_adec, estimado, real) VALUES ('12345', '7', '7', '3', '1', 2000-01-01, 2000-01-01, 2000-01-01, 2000-01-01, 2000-01-01, 2000-01-01, '8', '9')
Ha habido un error al insertar los valores. 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 'real) VALUES ('12345', '7', '7', '3', '1', 2000-01-01, 2000-01-01, 2000-01-01, 2' at line 1.
la cosa es q segun yo todo esta bien, les dejo a continuacion el codigo donde hago la insercion:
Código:
alguien puede ayudarme? <?php $submitted_recep=$_POST["anyorecep"]."-".$_POST["mesrecep"]."-".$_POST["diarecep"]; $submitted_envio=$_POST["anyoenvio"]."-".$_POST["mesenvio"]."-".$_POST["diaenvio"]; $submitted_1rev=$_POST["anyo1rev"]."-".$_POST["mes1rev"]."-".$_POST["dia1rev"]; $submitted_revenvio=$_POST["anyo_1revenvio"]."-".$_POST["mes_1revenvio"]."-".$_POST["dia_1revenvio"]; $submitted_recepadec=$_POST["anyorecepadec"]."-".$_POST["mesrecepadec"]."-".$_POST["diarecepadec"]; $submitted_envioadec=$_POST["anyoenvioadec"]."-".$_POST["mesenvioadec"]."-".$_POST["diaenvioadec"]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Especificar Procesado</title> </head> <body> <?php if ($_POST['especificacion']) { include("conexion.php"); // Hacemos la comparacion MySql $consultar_coincidencia="SELECT * FROM especificaciones WHERE especificacion='".$_POST['especificacion']."'"; $consultando_coincidencia=mysql_query($consultar_coincidencia); echo mysql_error(); if(mysql_num_rows($consultando_coincidencia)==0) { // Con esta sentencia insertamos en la base de datos $insertar="INSERT INTO especificaciones (especificacion, descripcion, tipo, r_progress, r_hd, recepcion, envio, revision1, envio_revision1, rec_adec, envio_adec, estimado, real) VALUES ('".$_POST['especificacion']."', '".$_POST['descripcion']."', '".$_POST['tipo']."', '".$_POST['r_progress']."', '".$_POST['r_hd']."', $submitted_recep, $submitted_envio, $submitted_1rev, $submitted_envioadec, $submitted_revenvio, $submitted_recepadec, '".$_POST['estimado']."', '".$_POST['real']."')"; echo $insertar; echo " <br>"; mysql_query($insertar); // Ahora comprobaremos que todo ha ido correctamente $my_error = mysql_error(); if(my_error) { echo "Ha habido un error al insertar los valores. $my_error"; } else { ?> <html> <head> <meta http-equiv="Refresh" content="3;URL=esp_captura.php"> </head><body> Se guardó el registro satisfactoriamente</body></html><? } } else { echo "Campo duplicado, favor de regresar para corregirlo"; } } else { echo "Error, no ha introducido especificacion"; } ?> </body> </html>