Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emphasizing data found in SQL Statement

Status
Not open for further replies.

moxie249

Technical User
May 15, 2001
16
0
0
CA
I've looked all over, but I can't seem to find an answer to this...

The web I'm working on is for employees to submit daily reports showing anything important that happened at their facility the previous day. Most of these things are minor, and don't need to be examined, but some can be very important, and require further investigation. I have a page that checks 10 fields within the day's submissions for a list of 31 keywords (death, fire, police, etc.) which would require more attention.

The results show in a table with the facility's name, and a link to another page which shows the entire submission for the day.

What I want is for these 31 keywords to show up in bold, or in another colour, on the 2nd page, so that the people who have to look at the results don't have to read every word to find out what needs to be investigated, or further examined.

I seem to recall that Microsoft's site used to do this when a search was performed on their site. I don't think they do it anymore, though.

Any help would be greatly appreciated.

TIA,
Brenda X-)
 
What you would need to do is get the data in to an array, then search through the array and where word exist then show bold tag :

<%
thing = Split(Trim(LCase(&quot;thing I want to match to be bold&quot;))), &quot; &quot;)
query = Split(Trim(LCase(Request(&quot;query&quot;))), &quot; &quot;)
maxcounter = UBound(query)
for x = 0 to maxcounter
If query(x) = thing(x) Then
result = result + Replace(query(x), thing(x), &quot;<b>&quot; & query(x) & &quot;</b>&quot;)
Else
result = result + query(x)
End If
next
Response.Write result
%> Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Hmmm.. Sounds like it's going to be fun!

When I am looking at creating the array, should I go field by field? Like I said, I've got 10 fields (memo fields) that are filled with data. Meaning, should I create a function with the example you gave me, and run each field through the function before displaying it?

I think I get the basics, but if I run into more problems I'll probably be back!

TIA,
Brenda X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top