misspelled search query

Posted on 2007-07-31
Last Modified: 2013-12-12
I am using a mysql database.
when there is a search I usually make this query:
select * from user where = '%@name%'

now my question is:
How to have a search query when there is a misspelled word?
Question by:kecoak
    LVL 6

    Expert Comment

    I'm not sure I get what you're asking. Could you be a little more specific, maybe with an example or two?


    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    if SOUNDEX() or full-text search don't give what you need:

    then, you need to develop something "new" yourself, adapted to what you actually need...
    LVL 11

    Accepted Solution

    What he wants is ability to search using a misspelled word, so if there is a record in a database "computer", it needs to be found using words "computer" and "compputer" alike.

    Assuming that the data in database is spelled correctly you can have php do a spelling check on the form.  Some info
    So have that function get a word match from users misspellt word and put that match into your query.

    May be this too.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now