Rakki wrote:
Hi,
Can anybody give me the optimized query for full-text searching? User will be entering one or more words in a text box and I wanted to
display the records which has atleast one word of the user input.
Assume that my table has two fields USER and DESCRIPTION. I wanted to search the DESCRIPTION field for the input entered in the
textbox. I use PHP. Please help me.

Place a full-text index on the fields in question, and then use something like:

SELECT * FROM table WHERE MATCH(user, description) AGAINST ('$escaped_query') LIMIT 25

Where $escaped_query is the query that has been run through mysql_real_escape_string().

Jasper

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to