john01dav
john01dav

Reputation: 1962

Mysql error 1064, possibly noobish

I am trying to get my first website using mysql working. When I attempt to make the code to auto-create the tables on install there are errors. I have checked other posts with the same error id, but none of their solutions are applicable.

CREATE TABLE users (primarykeyid INT(11) NOT NULL AUTO_INCREMENT PRIMARY_KEY, username VARCHAR(20), password VARCHAR(32), email VARCHAR(40), salt VARCHAR(512))

But I get the 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 'PRIMARY_KEY, username VARCHAR(20), password VARCHAR(32), email VARCHAR(40), salt' at line 1

I Do not know what is causing the error as all of the mysql looks valid to me. However, I am new to mysql so please forgive me if this is a noobish mistake.

Thank you in advance :)

Upvotes: 0

Views: 26

Answers (1)

sunshinejr
sunshinejr

Reputation: 4854

You have the underscore in the PRIMARY KEY. PRIMARY_KEY => PRIMARY KEY

Upvotes: 3

Related Questions