Results 1 to 2 of 2

Thread: Highlight an search term

  1. #1
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Highlight an search term

    how to highlight the search word .....
    $data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE'%$find%'");

    //And we display the results
    while($result = mysql_fetch_array( $data ))
    {
    echo $result['fname'];
    echo " ";
    echo $result['lname'];
    echo "<br>";
    echo $result['info'];
    echo "<br>";
    echo "<br>";
    }

    //This counts the number or results - and if there wasn't any it gives them a little message explaining that
    $anymatches=mysql_num_rows($data);
    if ($anymatches == 0)
    {
    echo "Sorry, but we can not find an entry to match your query<br><br>";
    }

  2. #2
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    Is this a question?
    - Josh

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •