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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:11:12+00:00 2026-06-05T15:11:12+00:00

I’m trying to implement a database search, by using match , against and fulltext

  • 0

I’m trying to implement a database search, by using match, against and fulltext indexing. So, when I did the search, it did not work as expect, no errors and no results was given. I’m querying by using Codeigniter.

Here is my PHP query code:

$clean_keyword = trim($keywords); //$keyword is passed to the function`
$this->db->select('question, answer')
         ->from('QA')
         ->where('MATCH(question) AGAINST("'.$clean_keyword.'")', null, FALSE);  
$query = $this->db->get(); //execute the previous statement and save the result in a variable. 

No errors from codeigniter/MySQL was given.

I tried to debug the $query variable by doing var_dump($query), see the results (N.B. The important part is result_array with size=0):

object(CI_DB_mysql_result)[19]
  public 'conn_id' => resource(30, mysql link persistent)
  public 'result_id' => resource(38, mysql result)
  public 'result_array' => 
    array (size=0)
      empty
  public 'result_object' => 
    array (size=0)
      empty
  public 'custom_result_object' => 
    array (size=0)
      empty
  public 'current_row' => int 0
  public 'num_rows' => int 0
  public 'row_data' => null

MySQL table schema:

CREATE TABLE `QA` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question` varchar(200) CHARACTER SET utf8 NOT NULL,
  `answer` varchar(500) CHARACTER SET utf8 NOT NULL,
  `u_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `question` (`question`)
) ENGINE=MyISAM
  • 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-05T15:11:13+00:00Added an answer on June 5, 2026 at 3:11 pm

    There was no errors in my code/database schema or anything, I just realized that FULLTEXT search doesn’t show matches that only contains 1 word, example:
    if I query this:
    SELECT * FROM QA WHERE MATCH(question) AGAINST('drive');
    and there is one question with the word drive ONLY, ill get no matches.
    But if i alter the drive question column, to something like how to drive ill get a match.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.