Page 1 of 1

MySQL Error - Where!?

Posted: Thu Apr 15, 2004 4:59 am
by RadixDev
Here's the problem... I'm trying to add a user to a table called rdxls_users:

Code: Select all

INSERT INTO rdxls_users (usr,pwd,group,email,name,country,gender,dob,occupation,time,secret,answer,address,city,county,postcode,website) VALUES('username','password','normal','EMail', 'Name', 'UK','m','593132400','Job','1082022970', 'Hello' , 'Good Bye' , 'Address' , 'City' , 'County' , 'Post code' , 'website' )
When this is executed error comes up:-

Code: Select all

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,email,name,country,gender,dob,occupation,time,secret,answ
Here's the code for the table:-

Code: Select all

CREATE TABLE `rdxls_users` (
  `id` int(15) NOT NULL auto_increment,
  `usr` varchar(20) NOT NULL default '',
  `pwd` varchar(32) NOT NULL default '',
  `group` varchar(20) NOT NULL default '',
  `secret` tinytext NOT NULL,
  `answer` tinytext NOT NULL,
  `email` tinytext NOT NULL,
  `name` text NOT NULL,
  `country` varchar(5) NOT NULL default '',
  `gender` char(1) NOT NULL default '',
  `dob` int(11) NOT NULL default '0',
  `occupation` tinytext NOT NULL,
  `time` int(15) NOT NULL default '0',
  `address` mediumtext NOT NULL,
  `city` mediumtext NOT NULL,
  `county` mediumtext NOT NULL,
  `postcode` varchar(15) NOT NULL default '',
  `website` text NOT NULL,
  PRIMARY KEY  (`id`)
)
Any idea why?

Posted: Thu Apr 15, 2004 5:12 am
by JayBird
group and time are reserved MySQL functions.

You will need to rename your fields.

Mark

Posted: Thu Apr 15, 2004 5:14 am
by RadixDev
Doh! :lol: