$result = mysql_query("SELECT * FROM `table` WHERE `keyword` = '$keyword'");
print "Exact Matches:<br>";
if (mysql_num_rows($result) == 0) {
print "No exact matches found.";
}
else {
while ($row = mysql_fetch_array($result)) {
print $row["keyword"];
}
mysql_free_result($result);
}
$result = mysql_query("SELECT * FROM `table` WHERE `keyword` LIKE '%$keyword%'");
print "Other Matches:<br>";
while ($row = mysql_fetch_array($result)) {
print $row["keyword"];
}
}
I think. I just wrote that off the top of my head, and usually when I do that I have to spend a while debugging them.