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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:00:00+00:00 2026-06-09T03:00:00+00:00

I am trying to implement a search feature into my codeIgniter project. I have

  • 0

I am trying to implement a search feature into my codeIgniter project. I have a table called product_search, where I am set a fulltext index using the following command:

ALTER TABLE `product_search` ADD FULLTEXT (`prod_title`, `prod_desc`)

I then search it using the following codeIgniter code:

$this->db->select("prod_id");
$this->db->where("MATCH (`prod_title`, `prod_desc`) AGAINST ('{$searchStr}')");
$this->db->or_where("prod_id LIKE '%{$searchStr}%'");
$this->db->or_where("prod_sku LIKE '%{$searchStr}%'");
$this->db->or_where("prod_title LIKE '%{$searchStr}%'");
$this->db->or_where("prod_desc LIKE '%{$searchStr}%'");
    
$query = $this->db->get("product_search");

This, however, results in the following error:

Error Number: 1064

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 ‘AGAINST (‘silk’) OR prod_id LIKE ‘%silk%’ OR prod_sku LIKE ‘%silk%’ OR `prod’ at line 3

SELECT prod_id FROM (product_search) WHERE MATCH (prod_title, prod_desc) AGAINST (‘silk’) OR prod_id LIKE ‘%silk%’ OR prod_sku LIKE ‘%silk%’ OR prod_title LIKE ‘%silk%’ OR prod_desc LIKE ‘%silk%’

Filename: models/products_model.php

Line Number: 430

Why is it putting backticks around the MATCH?

If I remove the space inbetween MATCH and the brackets following it, then I get this error message:

Error Number: 1191

Can’t find FULLTEXT index matching the column list

SELECT prod_id FROM (product_search) WHERE MATCH(prod_title, prod_desc) AGAINST (‘silk’) OR prod_id LIKE ‘%silk%’ OR prod_sku LIKE ‘%silk%’ OR prod_title LIKE ‘%silk%’ OR prod_desc LIKE ‘%silk%’

Filename: models/products_model.php

Line Number: 430

However, I used the top command to add a fulltext index.
What is going wrong?

  • 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-09T03:00:04+00:00Added an answer on June 9, 2026 at 3:00 am

    I solved the problem by adding IN BOOLEAN MODE to against section the statement as below:

    SELECT `prod_id`
    FROM (`product_search`)
    WHERE MATCH (`prod_title`, `prod_desc`) AGAINST ('silk' IN BOOLEAN MODE)
    OR `prod_id` LIKE '%silk%' OR `prod_sku` LIKE '%silk%'
    OR `prod_title` LIKE '%silk%'
    OR `prod_desc` LIKE '%silk%';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a database search, by using match , against and fulltext
Trying to implement search with Sunspot Gem wich is using Solr.Fulltext search works fine
Hey folks I am trying to implement a search functionality in a website using
I am trying to implement depth first search algorithm using adjacency list representation of
I am trying to implement an efficient algorithm for nearest-neighbour search problem. I have
Im trying to implement the search feature in my website. when the search keyword
I'm trying to implement popup search window in a PHP project. I included JQuery
I'm trying to implement a Search-Function using c++ and libpqxx. But I've got the
I am trying to implement a search option in my google map using pincode...
I am trying to implement a search (Ctrl+F) feature on a XamDataGrid. How can

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.