Page 1 of 1

highlighting search words

Posted: Sat Nov 23, 2002 6:40 pm
by qads
hi,
how would i highlight search results? e.g....i search for "PHP" and it comes back as
PHP blah blah blah blah and yes here is another PHP
also, what is the best way to search a db table?

i am useing

Code: Select all

<?php
$sql = mysql_query("select title, text_block from table where text_block LIKE '%$searchword%'");
?>
is that the best way?

thanks alot guys....

Posted: Sun Nov 24, 2002 2:13 pm
by qads
never mind about the highlighting, i got to work :D

but i still would like to know about the best way to search db tables...

thanks