dgoodbourn Posted April 20, 2010 Share Posted April 20, 2010 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 More sharing options...
seventheyejosh Posted April 20, 2010 Share Posted April 20, 2010 'SHOW' is a reserved word. Encapsulate your field names in backticks ( ` ) or, don't name your fields illegally 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 Link to comment https://forums.phpfreaks.com/topic/199148-php-mysql-command-error/#findComment-1045219 Share on other sites More sharing options...
dgoodbourn Posted April 20, 2010 Author Share Posted April 20, 2010 Perfect, thanks very much, I didn't know about show. Ta, D. Link to comment https://forums.phpfreaks.com/topic/199148-php-mysql-command-error/#findComment-1045238 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.