monkeytooth Posted November 12, 2009 Share Posted November 12, 2009 I need to build up an ID system numeric only. Kind of like how myspace, and facebook, or even godaddy have a unique number based ID for each user. Now I know, this is generally a easy idea.. Make a table on a DB store the ID number lets say we want to start out at 10000 have it pull from the database each time someone signs up and add plus one to it. Then store the new number in the database accordingly. Now as simple as that may be I am looking at things in the concept of grander scale. The site this is intended for isn't going to sit idle long where its only going to get a few sign-ups an hour. We are talking about maybe several thousand any given hour here and there. So with that thought How do I maintain something like a unique id in a scenario like that id's can and will eventually overlap if i do it in the simple concept mentioned above. Without losing the integrity of the concept. I know I can pull the ID add+1 to it on every pull and update it, but what if the person decides to cancel the registration. What if a few dozen people do that in a row.. amung the hundreds of thousands of people expected to flood at any random time. Is it a pipe dream to think that I can keep the integrity 10000, 10001, 10002, etc.. with the reality of it being 10029, 10053, and so on.. Link to comment https://forums.phpfreaks.com/topic/181217-unique-id-tags/ Share on other sites More sharing options...
darkvengance Posted November 12, 2009 Share Posted November 12, 2009 When you create your MySQL database create a field and name it "id" then simply set it as unique and "auto incretment" and then MySQL will automatically add +1 to it everytime that something is put in there, also it will not allow multiple entries with the same id Link to comment https://forums.phpfreaks.com/topic/181217-unique-id-tags/#findComment-956012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.