highlighting search words

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

highlighting search words

Post 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....
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post 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
Post Reply