Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/02/2012, 03:10
Xanders
 
Fecha de Ingreso: enero-2007
Ubicación: Delante de un Pc
Mensajes: 26
Antigüedad: 17 años, 3 meses
Puntos: 0
Pregunta Update con php

Hola buenas a todos, tengo un problemilla con un código que ando montando y no tengo manera de que funcione siempre me tira este error:
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 'Web, descripcionweb=Descripcion Web, keywords=Keywords, alexaverifyid=Alexa ID,' at line 1
aqui os pongo los datos que tengo

Código SQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `maca_configuracion` (
  2.   `idconfiguracion` INT(1) NOT NULL,
  3.   `tituloweb` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL,
  4.   `descripcionweb` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL,
  5.   `keywords` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL,
  6.   `alexaverifyid` VARCHAR(50) CHARACTER SET utf8 DEFAULT NULL,
  7.   `msvalidate` VARCHAR(50) CHARACTER SET utf8 DEFAULT NULL,
  8.   `google` VARCHAR(50) CHARACTER SET utf8 DEFAULT NULL,
  9.   `adminemail` VARCHAR(100) CHARACTER SET utf8 DEFAULT NULL,
  10.   `personalemail` VARCHAR(100) CHARACTER SET utf8 DEFAULT NULL,
  11.   `titulomensajes` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL,
  12.   `semanal` VARCHAR(50) CHARACTER SET utf8 DEFAULT NULL,
  13.   `horario` VARCHAR(50) CHARACTER SET utf8 DEFAULT NULL,
  14.   `telefono` VARCHAR(20) CHARACTER SET utf8 DEFAULT NULL,
  15.   `tiempo` INT(1) DEFAULT NULL
  16. );


Código PHP:
Ver original
  1. exit("UPDATE maca_configuracion SET tituloweb=$tituloweb, descripcionweb=$descripcionweb, keywords=$keywords,
  2. alexaverifyid=$alexaverifyid,
  3. msvalidate=$msvalidate ,google=$google, adminemail=$adminemail, personalemail=$personalemail, titulomensajes=$titulomensajes,
  4. semanal=$semanal,
  5. horario=$horario, telefono=$telefono, tiempo=$tiempo WHERE idconfiguracion='$idconfiguracion'");

y aparece se muestra esto
Código SQL:
Ver original
  1. UPDATE maca_configuracion SET
  2.     tituloweb=Nombre Web,
  3.     descripcionweb=Descripcion Web,
  4.     keywords=Keywords,
  5.     alexaverifyid=Alexa ID,
  6.     msvalidate=Microsoft Id,
  7.     google=Google ID,
  8.     adminemail=Admin Email,
  9.     personalemail=Personale Email,
  10.     titulomensajes=Titulos Asunto,
  11.     semanal=Trabajo de,
  12.     horario=Horario de,
  13.     telefono=Teléfono,
  14.     tiempo=0
  15. WHERE idconfiguracion='0'

Pero en cuanto pongo esto
Código PHP:
Ver original
  1. $result =mysql_query("UPDATE maca_configuracion SET tituloweb=$tituloweb, descripcionweb=$descripcionweb, keywords=$keywords,
  2. alexaverifyid=$alexaverifyid,
  3. msvalidate=$msvalidate ,google=$google, adminemail=$adminemail, personalemail=$personalemail, titulomensajes=$titulomensajes,
  4. semanal=$semanal,
  5. horario=$horario, telefono=$telefono, tiempo=$tiempo WHERE idconfiguracion='$idconfiguracion'") or die(mysql_error());

me tira 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 'Web, descripcionweb=Descripcion Web, keywords=Keywords, alexaverifyid=Alexa ID,' at line 1

Un saludo y gracias