otuatail Posted December 13, 2010 Share Posted December 13, 2010 Hi MySql objects to one field in the table champions. The field is Group. Can't understand why. CREATE TABLE `Champions` ( `ID` int(11) NOT NULL auto_increment, `Date` datetime default NULL, `Channel` tinyint(1) default NULL, `Venue` tinyint(1) default NULL, `Home` tinyint(1) default NULL, `Away` tinyint(1) default NULL, `Group` tinyint(1) default NULL, `Visible` char(1) NOT NULL default 'Y', `HomeScore` tinyint(1) default NULL, `AwayScore` tinyint(1) default NULL, `Round` tinyint(1) default NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=0 AUTO_INCREMENT=1; INSERT INTO Champions (Date,Channel,Venue,Home,Away,Group,Visible,HomeScore,AwayScore,Round) VALUES ('2010-12-14 1:0:00',0,29,25,26,1,'Y',-1,-1,2) MySQL said: #1064 - 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 'Group,Visible,HomeScore,AwayScore,Round) VALUES ('2010-12-14 1:0:00',0,29,25' at line 3 Any ideas? Link to comment https://forums.phpfreaks.com/topic/221501-cant-insert-one-field-into-table/ Share on other sites More sharing options...
otuatail Posted December 13, 2010 Author Share Posted December 13, 2010 None of the tables use foreign keys Link to comment https://forums.phpfreaks.com/topic/221501-cant-insert-one-field-into-table/#findComment-1146612 Share on other sites More sharing options...
PFMaBiSmAd Posted December 13, 2010 Share Posted December 13, 2010 GROUP is a reserved keyword, as in GROUP BY... You either need to rename your column to something else or you must enclose it in back-ticks `` every time you use it in a query. Link to comment https://forums.phpfreaks.com/topic/221501-cant-insert-one-field-into-table/#findComment-1146615 Share on other sites More sharing options...
otuatail Posted December 13, 2010 Author Share Posted December 13, 2010 Thanks for that. Just not thinking today. Link to comment https://forums.phpfreaks.com/topic/221501-cant-insert-one-field-into-table/#findComment-1146620 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.