Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:06:04+00:00 2026-05-27T16:06:04+00:00

Hey I was wondering how I could fix my auto increment ID… it seems

  • 0

Hey I was wondering how I could fix my auto increment ID… it seems that everytime I add a row to the table, the ID is 1 off. So here’s an example.

My table currently looks like this:

MySQL Table

Now, as you can see, the last element jumps from 198 to 200. I want this one to be 199.
So say I manually change that last value(200) to 199, it will obviously work, but the next time my script adds a row to the table, it will be on off again(201). Any idea how I could fix it? Thanks for any help, sh042067.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:06:04+00:00Added an answer on May 27, 2026 at 4:06 pm

    Jim’s right that you should find out the root cause of the ‘missing’ id.

    But if you really just want to re-set the auto-increment counter, you can do this:

    ALTER TABLE my_table AUTO_INCREMENT=200;
    

    That should make the next auto-increment id value 200. (Assuming it’s MySQL)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, I'm just wondering what code I could use to auto change the size
Hey I was wondering how I could add on to my function draw(); draw
Hey guys I was wondering how I could make the title of my website
Hey guys I was wondering if someone could provide a little help. I've been
Hey there, was wondering if anyone could help a newbie on SQL and Python.
Hey guys I was wondering if anyone could help me with an issue im
Hey everyone - I am wondering if anyone could help me out - I
Hey. I have this javascript file that I'm getting off the web and it
Hey I was wondering how I could set up a clean up task on
Seems that it may not be possible, but hey I might as well ask,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.