Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    2
    Member #
    1096
    My part of code is...

    query=trimmed
    PHP Code:
    PHP Code:
    // now you can display the results returned
    while ($rowmysql_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:
    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:
    PHP Code:
    // now you can display the results returned
    while ($rowmysql_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 !!!

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:42 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com