Here is my code so far
<form method="post" name="search">
<input type="search" name="k" placeholder="Enter Keywords">
<input type="submit" value="Search">
</form>
<?
$skw = $_POST['k'];
if(isset($_POST['k'])){
$connect = mysql_connect('*', '*', '*')or die('Could not execute command. Please contact a administrator.');
mysql_select_db('*')or die('No database');
$query = "SELECT * FROM *** WHERE items LIKE '%$skw%'";
$result = mysql_query($query)or die(mysql_error());
echo "<table align=\"left\" border=\"1\" cellpadding=\"5\" cellspacing=\"3\">";
echo "\"" . $skw . "\"";
if(empty($result)){echo " Not Found!";}else{
echo " Found In";
while($row = mysql_fetch_array($result)){
echo "<tr><td>";
echo "<font color=\"#CC0000\">" . $row['tub_id'] . "</font>";
echo "</td><td>";
echo $row['items'];
echo "</td></tr>";
}
echo "</table>";
}}?>
How do I highlight the $skw in the result? I have tried using preg_replace, but i am very new to php and cannot get it to work. I understand that I can use classes to style it. Thank you for any help.