Jump to content


Photo

Incorrect syntax near 'auto_increment'??


  • Please log in to reply
1 reply to this topic

#1 lizrickaby

lizrickaby
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 20 September 2005 - 11:33 PM

I keep getting the error: Incorrect syntax near 'auto_increment'

Here is the code:
$createTable="CREATE TABLE internalKB (id tinyint( 4 ) NOT NULL auto_increment, title VARCHAR( 255 ), body LONGTEXT, datnum TIMESTAMP( 14 ), user VARCHAR( 100 ), category VARCHAR( 50 ), PRIMARY KEY ( id )) TYPE = MYISAM ";

Whenever I run a query with that, I get that error. I can't see anything that should be a problem, but I must be missing something.

#2 lizrickaby

lizrickaby
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 20 September 2005 - 11:53 PM

Continued to research after I posted and got it to work this way:

$createTable="CREATE TABLE internalKB (id int NOT NULL identity, title VARCHAR( 255 ), body TEXT, datnum TIMESTAMP, inputby VARCHAR( 100 ), category VARCHAR( 50 ), PRIMARY KEY ( id )) ";

The problem is that I'm using msSQL instead of mySQL, so there are TONS of tiney differances in syntax that I pretty much have to figure out on my own because msSQL isn't nearly as well used and discussed as mySQL!

Whew! Good thing everybody else in the office was gone when I finally got it to work, or they would have thought I was NUTS!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users