2 Replies - 705 Views - Last Post: 19 April 2010 - 05:56 PM

#1 gymangel812   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 116
  • Joined: 15-February 10

MySQL Syntax Error

Posted 19 April 2010 - 05:37 PM

I'm getting this error and I can't figure out why:
Error Code : 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 'UNSIGNED NOT NULL,
	description	VARCHAR(50),
	imagename	VARCHAR(30)
)' at line 4


This is all I'm trying to do:
DROP TABLE IF EXISTS sandwiches;
CREATE TABLE sandwiches
(
	sandwichid   	INT(3) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	sandwichname	VARCHAR(20) UNSIGNED NOT NULL,
	description	VARCHAR(50),
	imagename	VARCHAR(30)
);

This post has been edited by JackOfAllTrades: 20 April 2010 - 06:47 AM
Reason for edit:: Added code tags.


Is This A Good Question/Topic? 0
  • +

Replies To: MySQL Syntax Error

#2 keakTheGEEK   User is offline

  • D.I.C Regular
  • member icon

Reputation: 108
  • View blog
  • Posts: 344
  • Joined: 23-February 10

Re: MySQL Syntax Error

Posted 19 April 2010 - 05:49 PM

Try removing UNSIGNED attribute from your sandwichname VARCHAR(20) column.
Was This Post Helpful? 0
  • +
  • -

#3 gymangel812   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 116
  • Joined: 15-February 10

Re: MySQL Syntax Error

Posted 19 April 2010 - 05:56 PM

View PostkeakTheGEEK, on 19 April 2010 - 04:49 PM, said:

Try removing UNSIGNED attribute from your sandwichname VARCHAR(20) column.

nope still the same error.

edit: i just re-typed the whole thing and now it works.

This post has been edited by gymangel812: 19 April 2010 - 07:57 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1