Pregunta

Well, I'm making my code, but something weird occurs, I don't think that my code is wrong... But it is still dying I don't know why...

There is the error:

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 'release, media_img, media_video, req) VALUES ('games_2' ,'GTA IV', 'aa', 'PC, Xb' at line 1

And there is the Query:

 INSERT INTO gamedata (item_id, name, gamedesc, platform, dev, distributor, genre, players, lang, age, release, media_img, media_video, req) VALUES ('games_2' ,'GTA IV', 'aa', 'PC, Xbox 360, PS3', 'RockStar Games', 'Take 2', 'Acción, Aventura, Shooter', '1, 2-32 (online) (Competitivo: 2-16 / Cooperativo: 2-8)', 'Manual: Español, Textos: Español, Voces: Inglés', '3', '1228284000', 'a:1:{i:0;s:265:"http://media.gtanet.com/images/4498-gta-iv-screenshot.jpg\r\nhttp://media.gtanet.com/images/4590-gta-iv-screenshot.jpg\r\nhttp://media.gtanet.com/images/4499-gta-iv-screenshot.jpg\r\nhttp://www.thegtaplace.com/images/gta4/screenshots/pc/gta-iv-pc-screenshot_045.jpg";}', 'a:1:{i:0;s:42:"http://www.youtube.com/watch?v=Fh2egiqQY8A";}', 'Requisitos mínimos:\r\n\r\nSistema Operativo: Windows Vista SP1 / Windows XP SP3\r\nProcesador: Intel Core 2 Duo 1.8 Ghz, AMD Athlon X2 64 2.4 Ghz\r\nMemoria: 1.5GB Windows Vista / 1GB Windows XP\r\nEspacio en Disco: 16GB libres\r\nGráfica: 256MB NVIDIA 7900 / 256MB ATI X1900\r\nRequisitos recomendados:\r\n\r\nSistema Operativo: Windows Vista SP1 / Windows XP SP3\r\nMicroProcesador: Intel Core 2 Quad 2.4Ghz, AMD Phenom X3 2.1Ghz\r\nRAM: 2.5GB Windows Vista / 2.5GB Windows XP\r\nEspacio en Disco: 18GB libres\r\nGráfica: 512 MB NVIDIA 8600 / 512MB ATI 3870\r\nOtros: DVD-ROM de doble capa')

There is a raw version: http://pastebin.com/jgLcXbe1

Yes, It's too large, but I don't know if its there the problem, or I misstype something :-/

Thanks.

PD: The weird thing is that all is correct, all the rows in the table, and all the data as you can see... But for some reason PHP is throwing me that error...

¿Fue útil?

Solución

RELEASE is mysql reserved keyword you should round it by backticks Like that :

INSERT INTO gamedata (item_id, name, gamedesc, platform, dev, distributor, genre, players, lang, age, `release`,.......

Check reserved keywords here

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top