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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:02:33+00:00 2026-05-25T01:02:33+00:00

I am currently busy creating a search function that queries a user input string

  • 0

I am currently busy creating a search function that queries a user input string against certain row in a mysql table.

This is what the code looks like so far:

$space_separated = implode(" ", $keywords_array);

$dataQuery = "SELECT id, `desc`, price1, pack, measure, quantity
              FROM products
              WHERE MATCH (`desc`)
              AGAINST ('".$space_separated."' IN BOOLEAN MODE)";

It is not quite providing the desired functionality. I am aware that in boolean mode, i forfeight the use of scoring. But my problem is that this code does return partial matches on any set word.

An example of this would be if a user was searching for “chocolate” and they searched “olate”, no match will be returned. How would I work around this?

@Mark

Were you suggesting this?

$dataQuery = "SELECT id, `desc`, price1, pack, measure, quantity
              FROM products
              WHERE MATCH (`desc`)
              AGAINST ('".$space_separated."' IN BOOLEAN MODE)
              OR MATCH (`desc`)
              AGAINST ('".$space_separated."')";
  • 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-25T01:02:34+00:00Added an answer on May 25, 2026 at 1:02 am

    FULLTEXT searched for whole words only. You can specify a wildcard * behind a part of the word, but not before. So choco* will match chocolate', but*olate` will not.

    Also, default matching uses or for comparison. If you want to match all keywords, add a + before each keyword.

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

Sidebar

Related Questions

I'm currently busy writing business rules and user stories for a project I'm on.
Currently, if I want to output a SQL script for a table in my
Currently, I am developing a product that does fairly intensive calculations using MS SQL
I'm currently busy working on an IP ban tool for the early versions of
I currently have code similar to this for a form: $('#some-form') .submit(function() { //
i'm developing an application (wpf) that have 3 windows. in the main window user
I am currently busy refactoring big parts in my application. The main purpose is
I'm currently in the process of building a small shell within C++. A user
I am currently building a java-servlet-based web application that should offer its service to
I'm currently busy making a Python ORM which gets all of its information from

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.