Wendy James Posted August 22, 2005 Share Posted August 22, 2005 Hi :) Ok, I have this site I am working on and when someone tries to create an account it always assigns a specific #. No matter who it is, it assigns 2147483647 as the number. So if someone else comes along and wants to create an account they can not because it gives the "duplicate customer_id" code. Any ideas what would be causing this? There are customers already signed up and they range from 1-70 (70 being one I had to manually change to test this out, that is how I found out it was always adding someone with the same ID# cause the next account I created made the same #.) Thanks in advance! :) Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted August 22, 2005 Share Posted August 22, 2005 looks like one of the calculations for assigning ids reached an overflow 2147483647 = 0x7FFFFFFF limit for a 32bit signed integer. Must be a cap somewhere that was reached :D Link to comment Share on other sites More sharing options...
Wendy James Posted August 22, 2005 Author Share Posted August 22, 2005 Thank you for the reply. Not exactly sure what you mean though. There are only 70 customers. Any clue where this "cap" may be or what I should look for? Databases and mysql is not my strong suit. Ask me how to alter something in the layout though and I am on it. lol Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted August 22, 2005 Share Posted August 22, 2005 In our case int values are signed integers, so when the id > 2147483647 mysql_insert_id() will return negative values. Question is how you ended up with this figure? Anyways you need to modify the ids that have this number. Use the phpmyadmin on the customer structure there is this nextautoindex that specifies the next number to be used for the table. Sorry forgot in the phpmyadmin so with the table selected (so you see the structure) click "Operations" and the "Defrag Table" That should do it. Backup your dbase first as I am not sure how your dbase looks like. There other tables that rely on the customers. Link to comment Share on other sites More sharing options...
Wendy James Posted August 22, 2005 Author Share Posted August 22, 2005 If it makes any difference, it is doing it online and on my local server. This is the error but I already know it's duplicating the number, just not sure why it isn't doing the auto_increment like the database says customer_ID should be. Also, I have tried it with 3 versions of the create_account.php 2 with different contributions added, one is a stock osCommerce page so I am very unsure what is going on. 1062 - Duplicate entry '2147483647' for key 1 insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('2147483647', '0', now()) Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted August 22, 2005 Share Posted August 22, 2005 sorry wendy, I just edit my previous post for what you could do. Link to comment Share on other sites More sharing options...
Wendy James Posted August 22, 2005 Author Share Posted August 22, 2005 I already changed the customer ID that had this ID then tried to create another customer and got the same number. Not sure where nextautoindex is? Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted August 22, 2005 Share Posted August 22, 2005 yes because the nextautoindex that specifies the next number to be used for the table. and that is still 2147483647. See my previous post how to defrag the table. phpmyadmin->your dbase->customers Then click "structure" see what nextautoindex says in there then defrag (first backup) Link to comment Share on other sites More sharing options...
Wendy James Posted August 23, 2005 Author Share Posted August 23, 2005 Ok... I went into phpmyadmin, clicked on customers then on operations. At the bottom there is a Table options The last thing says auto_increment with a text box next to it. The text box has 2147483647 in it. Is that what should be in it? I made a second database, deleted all the customers and now it works fine so I need to figure out why this is having a problem cause this guy needs all his customer information. I didn't see any defrag but I did have these options. Check table Analyze table Repair table Optimize table Flush the table ("FLUSH") I really really really appreciate your help. This is something I have never come across before and I am sure it is something I had to have done when I merged his database with mine. Will never, ever do a site that already has info in their database ever again. lol Oh, I tried all those things I listed above and they didn't do anything. Just thought I should tell you. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2005 Share Posted August 23, 2005 I guess the "optimize table" option should be the one. Over here I have "Check" (Probably Analyze in your case) "Defragment" (probably "optimize") "Flush" (same) not sure what the repair option offers. There should be a question mark next to its of these options that goes to mysql development pages and explains in detail. The repair could be better but I dont see it here (maybe because I dont have errors in the tables) Did your nextautoincrement changed? Link to comment Share on other sites More sharing options...
Wendy James Posted August 23, 2005 Author Share Posted August 23, 2005 No, the next autoincrement remains the same. Even if I try and manually change it, it switches back. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2005 Share Posted August 23, 2005 hmm do you see the table options under the phpmyadmin (under operations). There is auto_increment value you should be able to change. Should be where it says options like "pack_keys", "checksum" etc Link to comment Share on other sites More sharing options...
Wendy James Posted August 23, 2005 Author Share Posted August 23, 2005 Actually that is what I was talking about that wouldn't change. But it finally accepted a low number. I picked 100 since that would be a good place to start for new site/new customers and it is working fine now. I want to thank you again for all of your help, it is really appreciated. This is the weirdest thing I have ever come across. 2 different servers giving the same auto increment problem. I don't know much about databases or mysql but if you ever need help with anything I owe you a big one. :) Your time is appreciated. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2005 Share Posted August 23, 2005 np, I am still thinking though....with 2147483647 customers I will be for permanent vacation :D Link to comment Share on other sites More sharing options...
Wendy James Posted August 23, 2005 Author Share Posted August 23, 2005 LMAO Tell me about it. He only had 69. I have NO idea where that number came from. I am just glad the problem was fixed. Thanks again! Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.