lizrickaby Posted September 20, 2005 Share Posted September 20, 2005 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. Quote Link to comment https://forums.phpfreaks.com/topic/2546-incorrect-syntax-near-auto_increment/ Share on other sites More sharing options...
lizrickaby Posted September 20, 2005 Author Share Posted September 20, 2005 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! Quote Link to comment https://forums.phpfreaks.com/topic/2546-incorrect-syntax-near-auto_increment/#findComment-8446 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.