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

  • Home
  • SEARCH
  • 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 501707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:13:02+00:00 2026-05-13T06:13:02+00:00

I have a database of phrases that users will search for from their own

  • 0

I have a database of phrases that users will search for from their own input. I want them to find the phrase regardless of what punctuation they use. For example if the phrase, “Hey, how are you?” is in the row, I want all of the following searches to return it:

  • “Hey! How are you?!”
  • “Hey how are you?”
  • “Hey 🙂 How are you?”

Right now, I have the columns ‘phrase’ and ‘phrase_search’. Phrase search is a stripped down version of phrase so our example would be ‘hey-how-are-you’.

Is there anyway to achieve this without storing the phrase twice?

Thank you!

-Nicky

  • 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-13T06:13:03+00:00Added an answer on May 13, 2026 at 6:13 am

    What you’ve done is probably the most time-efficient way of doing it. Yes, it requires double the space, but is that an issue?

    If it is an issue, a possible solution would be to convert your search string to use wildcards (eg. %Hey%how%are%you%) and then filter the SQL results in your code by applying the same stripping function to the database input and the search string and comparing them. The rationale behind this is that there should be relatively few matches with non-punctuation characters in-between the words, so you’re still getting MySQL to do the “heavy lifting” while your PHP/Perl/Python/whatever code can do a more fine-grained check on a relatively small number of rows.

    (This assumes that you have some code calling this, rather than a user typing the SQL query from the command line, of course.)

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

Sidebar

Related Questions

I have a search query that takes a phrase typed in by the user
I have a Search form in my database that takes in a string, explodes
I have a live search on my help page that searches our help database
i have database with two values id and val so i want to ask
I have database application, I want to allow the user to restore the deleted
i have DataBase function that calculate distance by coordinates CREATE OR REPLACE FUNCTION distance(lat1
that my problem: I have database table like that: id (AI) market_id 1 6
I have no clue how to phrase this question in a search engine. I'm
i am currently working on a project where i have 'units' that will have
I have a database table with around 1000 keywords/phrases (one to four words long)

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.