Jump to content
Larry Ullman's Book Forums

Recommended Posts

Can anyone see why PHPMYADMIN is spitting out this error message:

 

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 'NOT NULL,
price DECIMAL(6,2) UNSIGNED NOT NULL,
size VARCHAR(60) DEFAULT NULL,' at line 5

 

Error
SQL query:

CREATE TABLE prints(

print_id INT UNSIGNED NOT NULL AUTO_INCREMENT ,
artist_id INT UNSIGNED NOT NULL ,
print_name VARCHAR( 60 ) DEFAULT NOT NULL ,
price DECIMAL( 6, 2 ) UNSIGNED NOT NULL ,
size VARCHAR( 60 ) DEFAULT NULL ,
description VARCHAR( 255 ) DEFAULT NULL ,
image_name VARCHAR( 60 ) NOT NULL ,
PRIMARY KEY ( print_id ) ,
INDEX ( artist_id ) ,
INDEX ( print_name ) ,
INDEX ( price )
) ENGINE = MYISAM ;

 

 

Much appreciated

Share this post


Link to post
Share on other sites

 

print_name VARCHAR( 60 ) DEFAULT NOT NULL ,
 

 

 

I don't think you can have a column Default to Not Null. It should be default to NULL I would guess?

  • Upvote 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...