My part of code is...
query=trimmed
PHP Code:
// now you can display the results returned
while ($row= mysql_fetch_array($result)) {
$title = $row["ttitle"];
$string = ereg_replace ("<br />", " ", $ttitle);
$title2 = $row["ID"];
$title3 = $row["texxt"];
$title4 = $row["datee"];
$results = "$title3";
$results = "$replaced";
// highlighting code
$search=str_replace(" ","|", $trimmed);
$replaced=preg_replace("/({$search})/i","<b><font color=#ffoooo>\1</font></b>",$title3);
$search=str_replace("%","|", $trimmed);
//echo links
echo "$count.)
<a href=\"something\details.php?strid=$title2\">$string</a>";
echo "<br />";
// echo only 150 first characters
$length = 150;
$mySubstring = ereg_replace("(.{1,$length})[ .,].*", "\1", $results);
$text = $mySubstring.' ...';
//echo search result..not all code just
echo (...$title4...etc...$text);
Now, when I'm using this code, my first result is only printing ... cos of
PHP Code:
($text = $mySubstring.' ...'
huh, without any description and with no matter what searching keyword is.
example of search result :
1) ...
//cos of this from above, but second, third, fourth etc. and all others searching results "echo" first 150 characters like
2) something blah blah 150 characters then ...
3) something blah blah 150 characters then ...
etc
I want to first result also have some description too, and just to say, that searching keyword is highlighted in all that results
AND
when I changed this code with
PHP Code:
// now you can display the results returned
while ($row= mysql_fetch_array($result)) {
$title = $row["ttile"];
$string = ereg_replace ("<br />", " ", $title);
$title2 = $row["ID"];
$title3 = $row["texxt"];
$title4 = $row["datee"];
// I changed it like this... just rotate...
$results = "$replaced";
$results = "$title3";
Then I'm without highlighting but with description in the first searching result
WHY?
p.s.
I wish, hmm, that all searching results are with description and highlighting keyword, and not only 2,3,4,5 without the first one !!!