472,143 Members | 1,266 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

mysql create table error

wadro21
12
can someone tell me what is wrong with this?

Error
SQL query:
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE uploads(
  2.  
  3. upload_id int( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  4. file_name VARCHAR( 30 ) NOT NULL ,
  5. file_size INT( 6 ) UNSIGNED NOT NULL ,
  6. file_type VARCHAR( 30 ) NOT NULL ,
  7. description VARCHAR( 100 ) DEFAULT NULL ,
  8. date_entered TIMESTAMP,
  9. PRIMARY KEY ( upload_id ) ,
  10. KEY ( file_name ) ,
  11. KEY ( date_entered ) 
  12. ) CREATE TABLE urls(
  13. url_id SMALLINT( 4 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  14. url VARCHAR( 60 ) NOT NULL ,
  15. title VARCHAR( 60 ) NOT NULL ,
  16. description SMALLTEXT NOT NULL ,
  17. PRIMARY KEY ( url_id ) 
  18. ) CREATE TABLE url_categories(
  19. url_category_id SMALLINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  20. category VARCHAR( 20 ) NOT NULL ,
  21. PRIMARY KEY ( url_category_id ) 
  22. ) CREATE TABLE url_associations(
  23. ua_id SMALLINT( 4 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
  24. url_id SMALLINT( 4 ) UNSIGNED NOT NULL ,
  25. url_category_id TINYINT( 3 ) UNSIGNED NOT NULL ,
  26. date_submitted TIMESTAMP,
  27. approvedCHAR( 1 ) DEFAULT 'N' NOT NULL ,
  28. PRIMARY KEY ( ua_id ) 
  29.  
MySQL said:

#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 'CREATE TABLE urls (
url_id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, url VA' at line 7
Sep 4 '07 #1
2 1680
pbmods
5,821 Expert 4TB
Heya, Wadro.

There are two things wrong with the code you posted:
  • You didn't use CODE tags. Bad!
  • You're missing a semicolon after each table declaration.
Sep 4 '07 #2
wadro21
12
Thanks again!

i will try to remember to put my code in tages next time.
Sep 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by dave | last post: by
reply views Thread by Lenz Grimmer | last post: by
reply views Thread by Ed Smith | last post: by
reply views Thread by Mike Chirico | last post: by
4 posts views Thread by James E Koehler | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.