On my search result page, I wanted to search for "Nintendo DS Lite - Pink"

I used following code:


$search_text = "Nintendo DS Lite Pink";

$kt=split(" ",$search_text);//Breaking the string to array of words

// Now let us generate the sql 
	if($val<>" " and strlen($val) > 0)
		$q .= " name like '%$val%' or ";
}// end of while

//Remove the last 'OR'

Than the $q would be:

SELECT * FROM `products`
name like '%Nintendo%' or  
name like '%DS%' or  
name like '%Lite%' or  
name like '%Pink%'

And i am getting Mysql Output given below:

1) Activity Meter - DS.
2) Nintendo DS Red.
3) Nintendo DS Lite Pink.
4) Nintendo DS Lite Turquoise.

But the third result is most accurate/relevant then first two result.

Please help me out to get the most accurate row first then the relevant rows as per their relevancy with search term "$search_text"

Many Thanks in Advance.