Solved

How can I make the key word search results in bold

Posted on 2003-11-20
3
212 Views
Last Modified: 2013-12-24
How can I make the key word search results in bold. Below are my codes..

<cfquery name="Getbusiness" datasource="#DSNName#">
select * from TB_BusinessDev
where (NameOfBusiness LIKE '%#Search#%') OR (TypeOfBusiness LIKE '%#Search#%') OR (Mission LIKE '%#Search#%')
order by BusinessID
</cfquery>

I would like to make the search keyword to be bold or in a different color. Please Help.
0
Comment
Question by:visa1234_12
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Mause
ID: 9790250
Try this:

#replace(NameOfBusiness, Search, '<b>'&Search&'</b>', 'ALL')#

Let me know
Mause

0
 
LVL 6

Accepted Solution

by:
PE_CF_DEV earned 200 total points
ID: 9790658
#rereplacenocase(NameOfBusiness,"(#Search#)", "<B style=""color:black;background-color:##ffff66"">\1</b>", "ALL")#

This will retain the case of the search so if you search for Street street will not be replaced by Street. Also added the highlighting affect.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9860140
any feedback on this?
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now