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

  • SEARCH
  • Home
  • 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 5997767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:18:39+00:00 2026-05-23T00:18:39+00:00

My problem is: I have a table with an auto_increment column. When I insert

  • 0

My problem is: I have a table with an auto_increment column. When I insert some values, all is right.
Insert first row : ID 1
Insert second row : ID 2

Now I want to insert a row at ID 10.

My problem is, that after this there are only rows inserted after ID 10 (which is the normal behaviour ).

But I want that the database first fills up ID 3-9 before making that.

Any suggestions?

EDIT:

To clarify: this is for an URL shortener I want to build for myself.
I convert the id to a word(a-zA-z0-9) for searching, and for saving in the database I convert it to a number which is the ID of the table.

The Problem is now:
I shorten the first link (without a name) -> ID is 1 and the automatically name is 1 converted to a-zA-Z0-9 which is a

Next the same happenes -> ID is 2 and the name is b, which is 2 converted.

Next interesting, somebody want to name the link test -> ID is 4597691 which is the converted test

Now if somebody adds another link with no name -> ID is 4597692 which would be tesu because the number is converted.

I want that new rows will be automatically inserted at the last gap that was made (here 3)

  • 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-23T00:18:40+00:00Added an answer on May 23, 2026 at 12:18 am

    You could have another integer column for URL IDs.

    Your process then might look like this:

    • If a default name is generated for a link, then you simply insert a new row, fill the URL ID column with the auto-increment value, then convert the result to the corresponding name.

    • If a custom name is specified for a URL, then, after inserting a row, the URL ID column would be filled with the number obtained from converting the chosen name to an integer.

    And so on. When looking up for integer IDs, you would then use the URL ID column, not the table auto-increment column.

    If I’m missing something, please let me know.

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

Sidebar

Related Questions

I have problem with my application. I have table report, there are 2 column
Running into a problem. I have a table defined to hold the values of
I'm new to wicket and stuck with the following problem: I have a table
I have the following problem. I have a table with a few hundred thousand
I have a fairly simple sync problem. I have a table with about 10
I have a complex sorting problem with my SQL statement. I have a table
The problem is the following, I have a table of friendships in my database,
here is a simple problem. I have a table of 500 rows and what
Got a problem with a query I'm trying to write. I have a table
I have a problem with sorting items in table in PHP. Here is what

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.