Help with Text highlighting in search results


Please Help with Text highlighting in search results:

The function should be
str_replace( $term, “”.$term."", $search_results );

I need to enter the above code into the code source

the search type is like

(search engine gets db results, the type of source)

[code] $searchquery=“select * from site where (name like’%$term%’ or url like’%$term%’ or desc like’%$term%’) and credits > 0 and state = ‘Enabled’ order by credits DESC limit $start,$resultperpage”;

//echo $searchquery;




echo(" “.mysql_result($result,$x,‘name’).”
“.mysql_result($result,$x,‘desc’).” ");

I am not sure what to enter into the $search_results to work with the search engine script, maybe $searchquery but i tried.

can you help me my power is gone

Thank You,



I make it simpler.

the code has replace function(php)(should be right)

tr_replace( $search_term, "<span>".$search_term."</span>", $search_results );

all $search_term should be replaced with “.$search_term.”

I entered my search engine script above in the first post just to you, that you can see what type of script the search engine is, not all the script just a part from the script.

I need the replace function into the script, but I need help with it, to put the replace function into the search engine script so that it will work also.

I am not 100% sure what i need to enter to “$search_term” that the function uses the search engine script right.

If you have any comments or more questions please post it, thank you for helping me.