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 469843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:49:30+00:00 2026-05-12T23:49:30+00:00

I have a MySQL table with an auto-increment ID field. I’m filling the table

  • 0

I have a MySQL table with an auto-increment ID field. I’m filling the table with data from one source, with its own unique ID (starting from around 4 million up). I also want to insert my own data but don’t want it to conflict with the IDs already in the database.

Ideally I’d just insert it all at a lower ID. However, I have to use a function outside of my control (a built-in Joomla function) which will insert a new row if the ID is 0, but try and update it if it’s any other number.

So obviously if I try and insert a new row with and ID of 1, it will try to update the row with ID of 1, which doesn’t exist. So no data gets inserted.

I’ve tried setting the auto-increment value lower than the current max id but it doesn’t work. Is there another solution to my problem?

UPDATE: To try and clarify my question, I have data from another source with a high ID (from 4 million and increasing). I want to insert rows with a low ID, from 1 and up (the external source will not conflict with this). However, for the reasons described above, I can’t just find an unused low ID and use that, I have to either use zero or find some other solution.

  • 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-12T23:49:30+00:00Added an answer on May 12, 2026 at 11:49 pm

    I found a solution: store the external IDs in a different field!

    The IDs that are coming from the external source are now stored in an “extid” field, so I can keep a check on that field (for my own updating). I made the main ID field an auto-incrementing primary key, which I can use to refer to the articles in various places.

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

Sidebar

Related Questions

I have a mysql table with an auto increment field. I am using the
I have a MySQL table with an auto-increment field and I am trying to
Hi I have a field in mySql table called jobnumber which auto increments with
In MySql I could have a table with an auto increment column and insert
Usually I would have a table field called ID on auto increment. That way
I have a MySQL table with approximately 3000 rows per user. One of the
I have a MySQL table, with the field ('ad_id'). I store variables in different
So, basically, I have a MySQL table called 'topics' and another one called 'replies',
I have MySQL table with the following structure: +---------+--------------+------+-----+---------+----------------+ | Field | Type |
I have MySQL table that doesn't have AUTO_INCREMENT field. In PHP I run this

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.