• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Can someone check over this ? SQL Syntax error

Smolek

Diamond Member
Got this script from someone and when i go to import it in to the database I receive the sql syntax error with the highlighted text below in red. Since Im not very familiar with this (yet) I was hoping someone can check over this and let me know if they see a problem with the script.

Here it is

SQL-query :

CREATE TABLE amazon(

ID tinyint( 5 ) unsigned NOT NULL auto_increment,
ASIN varchar( 10 ) NOT NULL default '0',
CLICKS tinyint( 10 ) unsigned NOT NULL default '0',
DESCRIPTION text,
PRIMARY KEY ( ID ) ,
UNIQUE KEY ASIN( ASIN ) ,
UNIQUE KEY ID( ID ) ,
KEY ID_2( ID ) ,
FULLTEXT KEY DESCRIPTION( DESCRIPTION )
) TYPE = MYISAM

MySQL said:

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 'ASIN( ASIN ) , UNIQUE KEY ID( ID ) , KEY ID_2( ID ) , FULLT


Any help would be greatly appreciated.
Thanks
 
From the looks of it you don't need that first ASIN of the line
so I think it should just look like:
UNIQUE KEY (ASIN)

and once that is fixed it will most likely give the same error for the next line too.

But, I'm most likely wrong, haven't done SQL in a long time, and that was just in college
 
CREATE TABLE amazon(

ID tinyint( 5 ) unsigned NOT NULL auto_increment,
ASIN varchar( 10 ) NOT NULL default '0',
CLICKS tinyint( 10 ) unsigned NOT NULL default '0',
DESCRIPTION text,
PRIMARY KEY ( ID ) ,
UNIQUE KEY ( ASIN ) ,
UNIQUE KEY ( ID ) ,
KEY ID_2 (ID),
FULLTEXT KEY DESCRIPTION( DESCRIPTION )
) TYPE = MYISAM


That should work.

Rob
 
Back
Top