Calgaryalberta Posted January 27, 2008 Share Posted January 27, 2008 I have a validation script that emails users once they register on the website. Right now its just sending them a UserID of 1,2,3,4,5 and so on. What I would like it to do is when users register the script assigns that user number 270 and then counts up from there, so the next user will be 271, 272 and so on. So when they get their activation email for their UserID it says "270", then 271 for the next user and so on... Ill post my script if necessary, I just thought it might be a quick fix. All the attempts Ive made to get the script to do this have failed, was looking for some help as to what to add to the script to get it to start at 270. Also do I need to change the initial value in the default column database to 270? - thanks Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/ Share on other sites More sharing options...
marcus Posted January 27, 2008 Share Posted January 27, 2008 In your database make the auto_increment start at 270. ALTER TABLE `table` AUTO_INCREMENT =270 Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/#findComment-450588 Share on other sites More sharing options...
Calgaryalberta Posted January 27, 2008 Author Share Posted January 27, 2008 thank you Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/#findComment-450598 Share on other sites More sharing options...
revraz Posted January 27, 2008 Share Posted January 27, 2008 You can also do it with phpmyadmin if you have that as well. Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/#findComment-450601 Share on other sites More sharing options...
Calgaryalberta Posted January 27, 2008 Author Share Posted January 27, 2008 Thats what I thought the gentlemen above meant with his post, change the default column in my phpmyadmin db to 270? Maybe I misunderstood. - How do I do it with PHPMyAdmin, I have my table open right now...? Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/#findComment-450731 Share on other sites More sharing options...
revraz Posted January 27, 2008 Share Posted January 27, 2008 Look at the options at the top, I believe it's Operations. Mgallforever gave your the SQL syntax to use from a sql command or from php. Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/#findComment-450737 Share on other sites More sharing options...
Calgaryalberta Posted January 28, 2008 Author Share Posted January 28, 2008 Alright yeah I did put that into my SQL, and it changed the value to 270, but I tried using my join script again, and the email just emailed the address I put in and assigned the number 2 didn't start at 270 Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/#findComment-450799 Share on other sites More sharing options...
revraz Posted January 28, 2008 Share Posted January 28, 2008 You sure it's reading the actual ID that is being created? Quote Link to comment https://forums.phpfreaks.com/topic/88070-what-is-the-proper-way-to-do-this/#findComment-450817 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.