Below is my script so far. This displays the users search term in bold if it is an exact match. For example. if the user searched "john bloggs" then it would be returned bold. whereas if the user searched for "john" then it would show the john bloggs entry but it wouldnt be in bold. Any help would be greatly appreciated.
<?
mysql_connect ("localhost", "user","pass") or die (mysql_error());
mysql_select_db ("databasename");
$term = $_POST['term'];
$sql = mysql_query("select * from tablename where category like '%$term%' or title like '%$term%' or postcode like '%$term%' or info like '%$term%' ");
while ($row = mysql_fetch_array($sql)){
echo '<br/> Category: '.str_replace($term,'<b>'.$term.'</b>',$row['category']);
echo '<br/> Title: '.str_replace($term,'<b>'.$term.'</b>',$row['title']);
echo '<br/> Address: '.$row['add1'];
echo '<br/> Street: '.$row['street'];
echo '<br/> City: '.$row['city'];
echo '<br/> Postcode: '.str_replace($term,'<b>'.$term.'</b>',$row['postcode']);
echo '<br/> Phone: '.$row['phone'];
echo '<br/> E-Mail: '.$row['email'];
echo '<br/> Website: '.$row['website'];
echo '<br/><br/>';
}
?>