Ver Mensaje Individual
  #26 (permalink)  
Antiguo 07/06/2010, 09:24
Avatar de Most
Most
 
Fecha de Ingreso: marzo-2009
Mensajes: 642
Antigüedad: 15 años, 1 mes
Puntos: 6
Respuesta: problema con form

Cita:
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 2
eso me ha devuelto

el code:
Código PHP:
Ver original
  1. <?
  2.       //recibimos las variables enviadas por el formulario
  3.       $caratula=$_POST['caratula'];
  4.       $nombre=$_POST['nombre'];
  5.       $anio=$_POST['anio'];
  6.       $servidor=$_POST['servidor'];
  7.       $detalles=$_POST['detalles'];
  8.       $enlaces=$_POST['enlaces'];
  9.       //conectamos a la base
  10.       $connect=mysql_connect("xxxx","xxx","xxx");
  11.       //Seleccionamos la base
  12.       mysql_select_db("xxx",$connect);
  13.       //insertamos los registros almacenados en las variables
  14.        mysql_query("insert into noticias(caratula,nombre,anio,servidor,detalles,enlaces)
  15.     VALUES ('".$caratula."','".$nombre."','".$anio."','".$servidor."','".$detalles."','".$enlaces." ' ",$connect) or die (mysql_error());
  16.  
  17.      echo "insert into noticias(caratula,nombre,anio,servidor,detalles,enlaces)
  18.     VALUES ('".$caratula."','".$nombre."','".$anio."','".$servidor."','".$detalles."','".$enlaces." ' ";