Jump to content

Mysql keeps giving me errors, help


Nick99
 Share

Recommended Posts

here is what I'm using

INSERT INTO users (username, password, desc, postcount, type, email) VALUES('sa', 'sa', 'sa', '1', 'sa', 'sa')

It keeps giving me 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 'desc, postcount, type, email) VALUES('sa', 'sa', 'sa', '1', 'sa', 'sa')' at line 1

I'm doing this through the mysql query browser, because it didn't work in PHP.

Link to comment
Share on other sites

desc is reserved keyword in sql, put the fields between ``, so u get:INSERT INTO `users`(`username`,`password`,`desc`,`postcount`,`type`,`email) VALUES('sa','sa','sa','1','sa','sa');

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...