DiamondLion
DiamondLion

Reputation: 13

How to fix MySQL INSERT INTO (Syntax Error)?

This is my code

USE `es_extended`;

INSERT INTO `users` (
  `license` varchar(50),
  `money` int(11),
  `bank` int(11),
  `permission_level` int(11)
);

And every time I try to import it to my database I got this error

#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 'varchar(50),
  `money` int(11),
  `bank` int(11),
  `permission_level` int(11)
)' at line 2

Upvotes: 0

Views: 938

Answers (1)

Svein Terje Gaup
Svein Terje Gaup

Reputation: 1578

This will create your table:

Create table `users` ( `license` varchar(50), `money` int(11), `bank` int(11), `permission_level` int(11) );

To insert you could do:

Insert into  `users` ( `license`, `money`, `bank`, `permission_level`) values ('test', 123, 456, 789)

Upvotes: 2

Related Questions