Help with Mysql fulltext search


In my site I am using fulltext search to search data from the database using php query.But the search is not working properly and it retrieves irrelevant data.

Can anyone pls guide me how to use mysql fulltext search efficiently.

Please supply:

  1. the search script
  2. results expected
  3. irrevelant results received



The search query is "select title,subject,match(title,subject) against (‘javascript in_array’) from test where match(title,subject) against (‘javascript in_array’)>0 ".

The result I obtain contains all the entry that contains a single word “javascript”.But I want the result to be exact or most relevant.

Try this in your PhpMyAdmin:

  SELECT title, subject
  WHERE  (title LIKE '%javascript%'AND title LIKE '%in_array%')	 
  WHERE  (subject LIKE '%javascript%' AND subject LIKE '%in_array%')
  FROM    test
  ORDER BY title

Hopefully you have the title and subject fields in your table structure set to _ci (case insensitive)