Search code examples
phpmysqldatabasesql-like

Merging DB Content From 2 DBs, Need To Avoid Non-Exact String Likenesses


Maybe I am day-dreaming but I am about to merge the contents of two large tables which represent two companies versions of the same data. I'd like to avoid duplicates (entries with the "title" field from DB 1 being almost the same as the "title" from DB 2. Are there any methods in php or mysql do do close string matches and return a relevance factor? Or any good php classes anyone knows of to check for likeness?


Solution

  • Try the levenstein function in PHP.

    In MySQL you will have to write stored procedure for that.