Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

My SQL Error (please help)


Chris Smith

Recommended Posts

Hi. I'm having trouble with this peice of code in my SQL:

 

ALTER TABLE `shoutbox` DROP PRIMARY KEY ALTER TABLE `shoutbox` ADD `idshout` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY

 

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 'ALTER TABLE `shoutbox` ADD `idshout` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY K' at line 2

 

MySQL version 5.0.27-standard-log

 

Can anyone help me please.

 

Chris

Link to comment
Share on other sites

Hi. I'm having trouble with this peice of code in my SQL:

 

ALTER TABLE `shoutbox` DROP PRIMARY KEY

ALTER TABLE `shoutbox` ADD `idshout` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY

 

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 'ALTER TABLE `shoutbox` ADD `idshout` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY K' at line 2

Chris

Hi Chris,

Not sure if you ran both queries in one attempt, please run one at a time -

ALTER TABLE shoutbox DROP PRIMARY KEY ; [No need for single quote ' ]

 

Then run the one below

 

ALTER TABLE shoutbox ADD idshout INT( 11 ) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(idshout) ;

Best Regards,
Gaurav

Link to comment
Share on other sites

Hi Chris,

Not sure if you ran both queries in one attempt, please run one at a time -

ALTER TABLE shoutbox DROP PRIMARY KEY ; [No need for single quote ' ]

 

Then run the one below

 

ALTER TABLE shoutbox ADD idshout INT( 11 ) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(idshout) ;

 

Doh. :blush:

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...