Dracolas Posted January 15, 2010 Share Posted January 15, 2010 How do you set up the page so that when it inserts into the database it takes the next # in a field. as in when you register a member and there is 2 members the page automatically make that member 3... i know it can be done but i can't find the coding to do it. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/188590-using-s-to-differentiate-entries/ Share on other sites More sharing options...
Buddski Posted January 15, 2010 Share Posted January 15, 2010 You need to make the 'id' field we will call it an auto-increment. Mysql will take care of it then Quote Link to comment https://forums.phpfreaks.com/topic/188590-using-s-to-differentiate-entries/#findComment-995672 Share on other sites More sharing options...
Dracolas Posted January 15, 2010 Author Share Posted January 15, 2010 ok so do i put anything in the coding on the page? Quote Link to comment https://forums.phpfreaks.com/topic/188590-using-s-to-differentiate-entries/#findComment-995673 Share on other sites More sharing options...
Buddski Posted January 15, 2010 Share Posted January 15, 2010 Nope.. Quote Link to comment https://forums.phpfreaks.com/topic/188590-using-s-to-differentiate-entries/#findComment-995677 Share on other sites More sharing options...
Dracolas Posted January 15, 2010 Author Share Posted January 15, 2010 why type do i use? Quote Link to comment https://forums.phpfreaks.com/topic/188590-using-s-to-differentiate-entries/#findComment-995679 Share on other sites More sharing options...
Buddski Posted January 15, 2010 Share Posted January 15, 2010 int and make it primary key. Quote Link to comment https://forums.phpfreaks.com/topic/188590-using-s-to-differentiate-entries/#findComment-995682 Share on other sites More sharing options...
laffin Posted January 15, 2010 Share Posted January 15, 2010 and dont assign it in your query INSERT INTO users SET username='blah',password='bleh'; Quote Link to comment https://forums.phpfreaks.com/topic/188590-using-s-to-differentiate-entries/#findComment-995686 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.