MySQL Fulltext Search Function

mysql_logo

MySQL full-text search is built-in funtion in mysql.
here is the sql comparison between normal search and full-text search:

nomal ;

-SELECT * FROM tblApit WHERE myMsg LIKE ‘%$str_search%’;

Full Text;

– ALTER TABLE tblApit ADD FULLTEXT(myMsg);

– SELECT * FROM tblApit WHERE MATCH(myMsg) AGAINST(‘$str_search’);

your may also search in more than one table; example;

– ALTER TABLE tblApit ADD FULLTEXT(myMsg,myDetails);

– SELECT * FROM tblApit WHERE MATCH(myMsg,myDetails)
AGAINST(‘$str_search’);

ok.. good luck

— by apit

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s