Re: [PHP] highlighting Search Results

2002-05-06 Thread Justin French
If you want to highlight the EXACT search string, do a str_replace() on $row["Description"], $row["ProductName"], etc etc, replacing the search phrase with $searchSite. Pretty simple. $siteSearch", $row["Description"]); $productName = str_replace($siteSearch, "$siteSearch", $row["ProductName"])

RE: [PHP] highlighting search results (revisited)

2001-04-18 Thread Matt Williams
Hi James I'll paste the code I use.. $string = search string entered in the text box. # // REPLACE SPACES FOR MULTIWORD SEARCH $string = str_replace(" ","%",$string); $db->query("SELECT title,description FROM files WHERE (title LIKE '%

FW: RE: [PHP] highlighting search results (revisited)

2001-04-18 Thread Matt Williams
> The input from the search form is $searchtext. The Returned > Search data is > $searchdata. > > > $sql = "SELECT searchdata FROM table WHERE searchdata LIKE > '%$searchtext'"; > $result = @mysql_query($sql, $connection) > or die (mysql_error()); > > $num = mysql_num_rows($result); > > $x