NYCPHP Meetup

NYPHP.org

Highlighting keywords in query

Dennis Butler dennis at webstew.com
Fri May 16 07:48:09 EDT 2003


If I wanted to print just the keywords the user typed into a form, 
within the query results, say in a red font, but leave the rest of the 
data from the table cell in black, is there a way of inserting some 
logic inside the print statement within an SQL query to isolate only the 
matched word that was typed in. 

Let's say I typed in "dynamics" in the keyword field of the form and my 
results were lists of titles such as "Intensity dependence and transient 
dynamics of donor-- acceptor pair recombination in ZnO thin films grown 
on (001) silicon"  I want only the word "dynamics" to be red and the 
rest of the title to be black, is this possible with a MySQL query?

Thanks,
Dennis





More information about the talk mailing list