0

I have never used mysql before so this is my first attempt. The syntax/coding im using...

"CREATE pets (" 
                + "uuid INT NOT NULL,"  
                + "type VARCHAR(100) NOT NULL," 
                + "name VARCHAR(100) NOT NULL,"  
                + "health INT NOT NULL,"
                + "badge VARCHAR(40),"
                + ")"

And the error is

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 'pets (uuid INT NOT NULL,type VARCHAR(100) NOT NULL,name VARCHAR(100) NOT NULL,he' at line 1

1
  • CREATE TABLE pets... Commented Mar 21, 2014 at 22:24

1 Answer 1

3

Add table to the first line

"CREATE table pets (" 

Remove the comma at the end of this line

+ "badge VARCHAR(40),"
                    ^------here

Generally if you look at the error message you see the first problematic point right after for the right syntax to use near

Sign up to request clarification or add additional context in comments.

1 Comment

I removed it and still getting the same error. I want a table with uuid as the int id and then type, name and badge as a string and health as a int @juergen-d EDIT: Didn't have table let me try that

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.