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 ) Link to comment https://forums.phpfreaks.com/topic/37654-adding-user-id/ 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 ; Link to comment https://forums.phpfreaks.com/topic/37654-adding-user-id/#findComment-180129 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 Link to comment https://forums.phpfreaks.com/topic/37654-adding-user-id/#findComment-180130 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.