Hello everyone. I try to search and display a exactly word, for example: I am interested to search after "Database", so it should display ONLY "Database". NOT DISPLAYS LIKE THIS: Database, Data, Datasheet, Database oracle.....
My php coding did not display anything.
Hope you can help me. Thanks
<?php
include("dbconnect.php");
$search=$_POST["sok_emne"];
if(!$search)
{
echo("New search. <a href='sok_emne_link.php'>Try again</a>");
}
else
{
$result=mysql_query("SELECT *FROM media WHERE Innhold REGEXP '(^|\s)$search($|\s)'");
if(mysql_num_rows($result) <= 0)
{
echo (mysql_num_rows($result))." No match. <a href='sok_emne_link.php'>Prøv igjen</a><br> ";
}
else
{
echo (mysql_num_rows($result))." Match/Matches.<br>";
}
while($r=mysql_fetch_array($result))
{
$Innhold=$r["Innhold"];
echo "<a href='sok_emne_list.php?emne=$Innhold'>[ $Innhold ] </a><br>";
}
}
?>