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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:00:50+00:00 2026-06-17T16:00:50+00:00

I have this SQL query that keeps shooting me an error: You have an

  • 0

I have this SQL query that keeps shooting me an error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘OR description IN BOOLEAN MODE) ORDER BY datetime ASC LIMIT 0,20′ at line 4

This is the query I’m attempting to run:

$items = $itemsClass->getAll($start , $limit, " `status` = 'active' AND MATCH (".sql_quote($s).") AGAINST (`name` OR `description` IN BOOLEAN MODE) ".$whereQuery, "$order");

Why: I’m working on a search function for a website and when we search for a certain keyword (i.e. cake), it shows the relavent items. But, when we search for ‘cook’ which is also in the same title/ description as the cake item, it doesn’t result any results and says it’s empty.

I can’t seem to figure out why I’m getting this error for the query. I’m just trying to find a solution to my problem. I’m using MySQL 5.1.66.

  • 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-17T16:00:51+00:00Added an answer on June 17, 2026 at 4:00 pm

    First of all, you put column names in the MATCH() function, and patterns in the AGAINST() function. You’re doing it the wrong way around.

    Second, searches across multiple columns are implicitly “OR” comparisons, in that a keyword match in any of the indexed columns counts as a match.

    So you should use:

    ... MATCH (`name`, `description`) AGAINST (".sql_quote($s).") IN BOOLEAN MODE)"
    

    The columns you name in the MATCH() function must be all the columns you defined in your fulltext index, and in the same order as they appear in the index.

    Only if you defined two separate fulltext indexes, one for each column, then you need to use two separate predicates.

    ... MATCH (`name`) AGAINST (".sql_quote($s).") IN BOOLEAN MODE)
        OR 
        MATCH (`description`) AGAINST (".sql_quote($s).") IN BOOLEAN MODE)"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running this SWL query keeps returning: #1064 - You have an error in your
I've got a simple SQL query that keeps throwing an SQL syntax error. It
I have this SQL Query that pulls data from 3 tables. I am unable
I have a custom SQL query that I run with this line: @avg_score =
I have a SQL query in my ASP.net web app that looks like this:
i have this sql query select * from table where name like ? but
I have this SQL query from the logs select content = 5%id%201=1 from pages
I have this SQL query select case when AllowanceId is null then 2 else
I have this sql query: SELECT S.SEARCH, S.STATUS, C.TITLE AS CategoryName, E.SEARCH_ENGINES AS Engine,
I have this SQL query (in T-SQL): --DECLARE @strTerm varchar(300) --SET @strTerm = 'c'

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.