0

Hi,guys.I have some confusing on order priority of several column in same table.Let say i am using concat for my searching,

$search_keywords=strtolower($search);
$search_keywords = strip_tags($search_keywords);
$search_keywords = mysql_real_escape_string($search_keywords);
        	
$replace_keywords = preg_replace("/[^a-zA-Z0-9:-\s]/", " ", trim($search_keywords));
	$search_exploded = explode(" ",$replace_keywords); //get array keyword
			 	 
$search_exploded = array_unique($search_exploded);  //remove duplicate words
$x=0;
$construct2='';
$searchWords=array();

  foreach($search_exploded as $search_each){
	if(!in_array($search_each, $Filter['invalid_keyword'])&& strlen($search_each) > 2) {
                $searchWords[]=$search_each;
                $x++;
			 if ($x==1){
		$construct2 .= "concat(titleFull, ' ', descFull, ' ', keywords) LIKE '%$search_each%'";
					 	 	 
 }
   else{
	$construct2 .= " OR concat(titleFull , ' ', descFull, ' ', keywords) LIKE '%$search_each%'"; 	
					 	 	 }

so, i wanna ask how i count the occcurences keyword search order in each field (1.titleFull, 2.keywords , 3.descrpt).Can any guys give some idea or opinion on the concept counting priority?Thanks.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by stanley87
0

the query running will be something like

SELECT * FROM isosalis2.Game WHERE status='A' AND concat(titleFull, ' ', descFull, ' ', keywords) LIKE '%harry%' OR concat(titleFull , ' ', descFull, ' ', keywords) LIKE '%potter%' ORDER BY titleFull DESC,descFull DESC,keywords DESC
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.