List:General Discussion« Previous MessageNext Message »
From:Rhino Date:October 26 2005 4:16am
Subject:Re: Problem with syntax 4 creating 1 table
View as plain text  
  ----- Original Message ----- 
  From: Ed 
  To: mysql@stripped 
  Sent: Tuesday, October 25, 2005 6:40 PM
  Subject: Problem with syntax 4 creating 1 table


  Shawn green was very kindly helping me ouy trying to make mysql tables and I thought I
had go the hang of it until I get this error-any ideas? Thanks a lot 

  CREATE TABLE PurchasedProducts( 

  `int_saleCart` INT AUTO_INCREMENT NOT NULL ,
  `int_ClientID` INT,
  `int_ProductID` INT,
  `int_Quantity` INT,
  `int_saleCart` PRIMARY KEY ( int_saleCart ) 
  ) ENGINE = MYISAM 

  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 'PRIMARY KEY ( int_saleCart ) 
  ) ENGINE = MYISAM' at line 6 

You need a comma before the "PRIMARY KEY" clause. That should solve your problem. In other
words, change the second last line so that it looks like this:

`int_saleCart`,  PRIMARY KEY ( int_saleCart ) 
----------^------------------------

Rhino
Attachment: [text/html]
No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.361 / Virus Database: 267.12.5/148 - Release Date: 25/10/2005
Thread
Problem with syntax 4 creating 1 tableEd26 Oct
  • Re: Problem with syntax 4 creating 1 tableMichael Stassen26 Oct
  • Re: Problem with syntax 4 creating 1 tableRhino26 Oct
    • Re: Problem with syntax 4 creating 1 tableMichael Stassen26 Oct