avalonindigo Posted February 8, 2007 Share Posted February 8, 2007 I have a login for my website. To login, you provide username, password and email, which is then stored in a database. I want to add a user id number with auto-increasement but I dont want the user to have to input the number. Example: Mr P wants to become a member. He enters his username, password and email in the registration page and joins. He is the 11th person to join, so he is user id #11 Is this possible? (I wont post any of the code yet because last time i looked a bit daft and it was something stupid ) Quote Link to comment Share on other sites More sharing options...
only one Posted February 8, 2007 Share Posted February 8, 2007 yup CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(25) NOT NULL default '', `password` varchar(32) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Quote Link to comment Share on other sites More sharing options...
only one Posted February 8, 2007 Share Posted February 8, 2007 soz forgot to say, thats for creating the table in your database 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.