Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 28th, 2004, 02:37 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Problem: auto_increment has stopped increasing!

Hey. I have a problem with my 'id' field - it's set to auto_increment and has been working fine for a few weeks. However, I've now got up to row 127, and as it's a unique field it won't insert - phpMyAdmin tells me that the next autoindex is 127.

Nothing was changed in the table other than the entries...it seems like a total mystery to me. I've tried every which way round I can other than deleting the column and re-inserting it (not a good idea, I'd have to go through 127 rows afterwards and put the IDs back in, with no guarantee that it'll fix the problem).

Obviously, if there's no solution to the problem I'll just have to set up a work-around with last_insert_id(), but I really don't see why it's not working! Anyone got any ideas?

Reply With Quote
  #2  
Old January 28th, 2004, 02:44 PM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
RE: Problem: auto_increment has stopped increasing!

Can I see the SQL query which you use to insert data into the table? Mystery stuff!

Reply With Quote
  #3  
Old January 28th, 2004, 03:33 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: Problem: auto_increment has stopped increasing!

What data type is the auto_increment field? If it stopped at 127, I'm betting it only has 8 bits and is signed.

Reply With Quote
  #4  
Old January 28th, 2004, 07:23 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Problem: auto_increment has stopped increasing!

Thanks for the replies, guys (or girls).

It's tinyint, length 5 and it's a primary key.

I've tried using my query (see below) and doing it through phpMyAdmin...neither seems to work. If I do it through phpMyAdmin it tells me there's a duplicate entry with id 127 - it seems to have stuck at 127?!

Query:
insert into pw2_releases (title, image_location, category, id, description, user, date) values ('$release_title', '$image_location', '$category', '', '$description', '$user', '$date')

Reply With Quote
  #5  
Old January 28th, 2004, 08:04 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: Problem: auto_increment has stopped increasing!

Using a tinyint is your problem. From http://www.mysql.com/doc/en/Column_types.html:
Quote:
TINYINT[(M)] [UNSIGNED] [ZEROFILL]
A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.


Change it to something like an unsigned int instead.

Reply With Quote
  #6  
Old January 28th, 2004, 08:21 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Problem: auto_increment has stopped increasing!

Thankyou! You really are 'A Master Codewalker'! Although I might just be too much of a n00b ;)

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Problem: auto_increment has stopped increasing!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway