0

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
3
  • 2
    You are mixing elements of CREATE and INSERT Commented Sep 16, 2020 at 19:34
  • 1
    First thing you need to do before asking question here is read the basics of you want to use: mysqltutorial.org/mysql-insert-statement.aspx Commented Sep 16, 2020 at 19:35
  • 3
    Probably reading a SQL book will be a good start. Even I don't know what you are trying to do. Commented Sep 16, 2020 at 19:52

1 Answer 1

2

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.