Natedawg Posted December 28, 2003 Share Posted December 28, 2003 I need a query for adding a column to my table, an auto increment one, so I can keep track of how many items I have in my database. I think it\'s like, ADD COLUMN TO Message idno int AUTO_INCREMENT is that it? Quote Link to comment https://forums.phpfreaks.com/topic/1565-i-need-a-query-cant-find-it-anywhere/ Share on other sites More sharing options...
jmabbate Posted December 29, 2003 Share Posted December 29, 2003 The syntax is ALTER TABLE table_name ADD COLUMN column_name INT UNSIGNED NOT NULL AUTO_INCREMENT, ADD INDEX (column_name); You\'ll find an example in the MySQL manual, section 6.5.4 under ALTER TABLE. Joe Quote Link to comment https://forums.phpfreaks.com/topic/1565-i-need-a-query-cant-find-it-anywhere/#findComment-5142 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.