Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Auto_increment Jumping About, not sequential numbers
mica
post Apr 16 2008, 02:51 PM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 2
Joined: 16-April 08
Member No.: 29,831



Hello,

I've been having very strange problems with AUTO_INCREMENT. It will be sequential for the first 4 or so inserts and display them fine. After 3 or 4 or 5 inserts the FileID, which has the AUTO_INCREMENT applied to it, will then jump to a seemingly random number like 72, 49207, and so on.

My SQL for the table in question is:

CREATE TABLE `IPR` (
`FileID` int(11) NOT NULL auto_increment,
`Filename` varchar(40) NOT NULL,
`ContentType` varchar(15) NOT NULL,
`Description` varchar(150) NOT NULL,
`Status` char(10) NOT NULL,
`ApprovedBy` varchar(30) default NULL,
`Created` varchar(15) NOT NULL,
`Software` varchar(25) default NULL,
`Registered` varchar(15) NOT NULL,
`LocationDirectory` varchar(250) NOT NULL,
`CopyrightGroup` varchar(25) NOT NULL,
`FileCreator` varchar(30) NOT NULL,
`Ownership` int(3) NOT NULL,
`CopyrightStatus` varchar(20) default NULL,
`Comments` varchar(200) default NULL,
`SubmittedBy` varchar(30) NOT NULL,
PRIMARY KEY (`FileID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;


Even after these jumps, if I go in and delete or manually edit the record with the crazy FileID and then run
ALTER TABLE table_name AUTO_INCREMENT = 6;

it will still carry on jumping numbers either immediately or a row or two later. It's driving me crazy. Any help would be very much appreciated.

Thanks
Go to the top of the page
 
+Quote Post
faulty.lee
post Apr 16 2008, 03:57 PM
Post #2


Premium Member
Group Icon

Group: [HOSTED]
Posts: 440
Joined: 5-November 06
Member No.: 17,016



Well, sounds impossible. To prove it, I did tried it on MySQL 5.0 ran locally, well, it's not possible. I doubt it's an MySQL bug.

It's very likely that you might have insert the FileID along with some random number, or file_id you get from some file function. Check your insert query. You can also post the code section that do the inserting.
Go to the top of the page
 
+Quote Post
Darasen
post Apr 17 2008, 06:06 AM
Post #3


Member - Active Contributor
Group Icon

Group: [HOSTED]
Posts: 97
Joined: 3-April 08
From: Milling about
Member No.: 29,596



I do not know what RDBMS you are using or how the DB in question is being used so there may be a couple reasons. One is that your RDBMS just might do auto increment like that. at Siebel our records were auto incrimented by some formula I forget that ended with the millisecond. Of course systems do not repeat numbers even if the the record that previously had that number was deleted.
Go to the top of the page
 
+Quote Post
mica
post Apr 17 2008, 10:57 AM
Post #4


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 2
Joined: 16-April 08
Member No.: 29,831



Thankyou both for your responses, they're appreciated. I had been using the database with a PHP interface I hadn't tried before and that appears to be the source of the problem. I had people entering data into a form but keeping the FieldID off the form, so that they couldn't allocate one, and so that it only displays in the results where the SQL has incremented the FieldID to the next digit. It would appear there is some sort of conflict with the interface trying to make the hidden field a unique entry. Anyway, I've altered it within the interface coding and so far so good. Thankyou both for taking the time to consider the problem and reply.

Best wishes,

Michelle
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. VB: Howto Auto-select Last Item In Listbox(5)
  2. Grand Theft Auto: San Andreas(109)
  3. Auto Volume Controller For Windows(0)
  4. Orkut.com Auto Scrapper - Scrap Ur Friend List In One Go(11)
  5. Grand Theft Auto Iv(10)
  6. Stop AUTO_INCREMENT From Jumping(13)
  7. Laptop Auto Starts After Turning It Off(7)
  8. How To Make Hotmail Auto Forward Mails?(12)
  9. Auto Suspend Activated(1)
  10. Auto-click Script(6)
  11. Grand Theft Auto 4 Launch Date(5)
  12. Need Help In Database Auto_increment(9)
  13. Auto Screen Position Changing Possible?(5)
  14. A Special Grand Theft Auto Vice City Topic(5)
  15. Auto-number Help In Access Db & Vb .net(6)
  1. How To Auto Navigate Using Frames?(2)
  2. Auto Logout By Astahost(6)
  3. Irq(1)
  4. How To Show Serial Nums In PHP Table For Contents Of MySQL DB(4)
  5. Auto Responder Script(6)
  6. Google Suggest (beta)(9)
  7. ( Auto ) Playing Cds On Old Debian Installation ?(7)
  8. Auto-backup Your MySQL DBs Daily/weekly/monthly(9)
  9. Whats The Irc Channel Port Numbers?(3)
  10. Let's Make Rainbow Link(1)
  11. Auto Updating With One Command!(6)
  12. Help: Dns Server Auto Updataion(0)
  13. Grand Theft Auto: San Andreas(41)
  14. Auto-FTPing With A Batch File(1)
  15. Mastering Erlang Part 2 – Erlang Sequential(0)


 



- Lo-Fi Version Time is now: 4th July 2008 - 10:46 PM