RTS Posted September 29, 2006 Share Posted September 29, 2006 I am adding a private messaging system to my website, and am wondering, how do I add a distinct ID number to each message. I have a column named ID in a table called messages in a database called test. I want it to be so the first message will have id = 1, seccond message id = 2, and so on and so forth. Is this easy? How would I do it? Quote Link to comment Share on other sites More sharing options...
akitchin Posted September 29, 2006 Share Posted September 29, 2006 cast it as an INT type, add the AUTO_INCREMENT attribute, and make it a PRIMARY KEY. simple as that. Quote Link to comment Share on other sites More sharing options...
RTS Posted September 29, 2006 Author Share Posted September 29, 2006 yes! thank you! Quote Link to comment 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.