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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:14:55+00:00 2026-05-26T05:14:55+00:00

I have multiple entries in a temporary table in Database, and I need to

  • 0

I have multiple entries in a temporary table in Database, and I need to merge them to make permanent entries. Now the information is coming from multiple XML Feeds, and I have all sorts of information, but the closest that I have is the “title” or in my case, name of the product.
Unfortunately, I don’t have any other way (no same ID’s or anything like that) than to match them by their name.
So for example I have:

$primary = array('feedid' => 2, 'entry_name' => 'ACME Product Black Model #23');
$secondary = array('feedid' => 3, 'entry_name' => 'ACME Product Model #23');

The ACME Product May Vary from "ACME Product Model #23" to "Model 23", to “Black Model #23", etc.
Also, in the same feed I may have "ACME Product Model Black #22" and “CHOAM Product Black - Model 11".

The problem is that I can’t just use similar_text() or levenshtein(), because they would sometimes match wrong items, or sometimes just don’t match at all. Each feed has 100+ entries, and I can have up to about 10 feeds.

Edit:
To put in real terms, for example: “iPhone 4” and “iPhone 4 White” and “iPhone 4 Black” should all be merged ( I can handle the merging, need to match first ).
So the rules are – Match the phones in this case.
It could also be “Barby Doll White hair” and “Barby Doll Black Hair”, but not “Some other Doll with White Hair”. …

Any ideas appreciated 🙂

  • 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-26T05:14:55+00:00Added an answer on May 26, 2026 at 5:14 am

    I think it is worth to go with the pregmatch that hakre suggests.

    I would go like this:

    1. (Optionally) In the old-temporary table would add one more field of tinyint called flag.

    2. I would go with pregmatch and in a pregmatch success I would put a positive flag on the old table to indicate that this record was managed successfuly by pregmatch.

    3. If pregmatch failed would I would go with text similarity as hakre suggests again and would put a flag that was managed with text similarity.

    In the end I hope a big percentage of the records would have been managed by pregmatch and only few would hae a flag indicating “text similrity” management. This would make the problem smaller, I think. wouldn’t it?

    If you later find a better solution you can use the flag to know what records were not managed by pregmatch.

    Then as for retrieving the new data I would go with the whith text similarity, for example something like mysql like ‘%string%’.

    As for pregmatch being slow you will only do this process once,so shouldn’t be a problem. In addition I would add a conditioned loop in order not to exceed max execution time.

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

Sidebar

Related Questions

I have a ListView with multiple choice entries where some are checked from the
I have multiple classes that all derive from a base class, now some of
I have multiple text files that represent logging entries which I need to parse
I am trying to use a database where the email can have multiple entries,
I have multiple entries in a mysql table field, these are separated with commas;
I have a table with multiple entries and I have ordered it according to
I want to have a column in a database that can contain multiple entries.
How is it possible for a table to have multiple entries for a single
I have a XML document with my data in it, multiple entries for the
I have multiple threads (C# application running on IIS) running that all need to

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.