Jump to content

PHP MySQL command error


dgoodbourn

Recommended Posts

Hi all,

 

Not sure what's happening here but can anyone see why this PHP MySQL command is failing? I've also included the error.

 

Ta,

Dave.

 

INSERT INTO credits_theatre (id, name, show, director, company, place) VALUES (NULL, 'Lady Macbeth', 'Macbeth', 'Chris Geelan', 'Young Shakespeare Company', 3);

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 'show, director, company, place) VALUES (NULL, 'Lady Macbeth', 'Macbeth', 'Ch' at line 1

Link to comment
https://forums.phpfreaks.com/topic/199148-php-mysql-command-error/
Share on other sites

'SHOW' is a reserved word.

 

Encapsulate your field names in backticks ( ` ) or, don't name your fields illegally :P

 


INSERT INTO
`credits_theatre`
(`id`,`name`,`show`,`director`,`company`,`place`)
VALUES
(NULL,'Lady Macbeth','Macbeth','Chris Geelan','Young Shakespeare Company',3);

 

http://dev.mysql.com/doc/refman/5.0/en/show.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.