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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:23:53+00:00 2026-06-02T23:23:53+00:00

I am just learning about the Metaphone and Double Metaphone search algorithms, and I

  • 0

I am just learning about the Metaphone and Double Metaphone search algorithms, and I have a few questions. Per the Metaphone Wiki page, I found a couple sources with implementations, a MySQL implementation in particular. I wanted to test it out with a test database of mine so I first imported the metaphone.sql file (containing the double metaphone function) found here

Right now, I have a table, country, that has a list of all countries in the ‘name’ column, e.g. ‘Afghanistan’, ‘Albania’, ‘Algeria’, etc. So, first, I wanted to actually create a new column in the table to store the Double Metaphone string of each country. I ran the following code:

UPDATE country SET NameDM = dm(name)

Everything worked correctly. Afghanistan’s metaphone string is ‘AFKNSTN’, Albania’s is ‘ALPN’, Algeria’s is ‘ALKR;ALJR’, etc. “Awesome,” I thought.

However, when I tried to query the table, I got no results. Per the author of metaphone.sql, I adhered to the syntax of the following SQL statement:

SELECT Name FROM tblPeople WHERE dm(Name) = dm(@search)

So, I changed this code to the following:

SELECT * FROM country WHERE dm(name) = dm(@search)

Of course, I changed “@search” to whatever search term I was looking for, but I got 0 results after each and every SQL query.

Could anyone explain this issue? Am I missing something important, or am I just plain misunderstanding the Metaphone algorithm?

Thank you!

  • 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-06-02T23:23:56+00:00Added an answer on June 2, 2026 at 11:23 pm

    take a close look at the collation/character set/encoding (it can be defined down to the column level). Collation defines how strings are compared, but a character set can imply a certain collation be used. Maybe your literal string has a different character set, causing the string comparison to fail.

    even this may be revealing

    select name, length(name), char_length(name), @search, length(@search), char_length(@search) from tbl
    

    .

    show variables like 'character%'
    

    .

    show create table tbl
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started learning about ASP.NET, and I have a couple of questions. Am
I'm just learning about python. I'm fairly new. I have the following code that
I just started learning about CSRF. As per OWASP CSRF Article CSRF is an
I've just started learning Java (about a week ago) and the last few days
Just learning about sql joins and things, and I have a question. Can you
I'm just learning about ORM's, and am wondering... if you have an object (a
I'm just learning about C and got an assignment where we have to translate
I have a repo setup, and am just learning about how branches work. Right
I'm just learning about generics and have a question regarding method return values. Say,
Hi I have just started learning about xsd as I want to use it

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.