MySQL Error - Where!?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

MySQL Error - Where!?

Post 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?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

group and time are reserved MySQL functions.

You will need to rename your fields.

Mark
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

Post by RadixDev »

Doh! :lol:
Post Reply