Jump to content

Archived

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

lizrickaby

Incorrect syntax near 'auto_increment'??

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.