Jump to content
  • Advertisement
Sign in to follow this  
Fl4sh

[web] why doesn't this query work?

This topic is 3002 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


CREATE TABLE `memberarea`.`logins` (
`ID` SERIAL( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 20 ) NOT NULL ,
`password` VARCHAR( 10 ) NOT NULL ,
`permissions` TINYINT( 1 ) NOT NULL DEFAULT '0'
) ENGINE = InnoDB;



I don't know what the problem is....I get 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 '(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, `username` VARCHAR(20) NOT NULL, `pass' at line 1

Share this post


Link to post
Share on other sites
Advertisement
I think the main problem is that you haven't looked at the error message:

Quote:
check the manual that corresponds to your MySQL server version for the right syntax to use


Because, in the MySQL manual, we find this, and more specfically that:

Quote:
As of MySQL 4.1, SERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.


This took me approximately 30 seconds to find out.


Error messages often enough contain the right hint. But to find that hint, one must first read the message. I think this actually analogous to users not reading tool tips or message boxes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!