Hi everyone. I got many words from a searching column. The searching column displays many words, but i want to search the full word that displays as a link in order of alphabet. Look at this link for understanable (Søk = Search)
http://kg.out-force.com/sok_ordliste.php
I got help from someone here about how to search the full word, it, it did not work:
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10286263&highlight=search+whole+word
Thanks
<?php
include("dbconnect.php");
$search=$_POST["sok_ordliste"];
if(!$search)
{
echo("Task inn ett søk. <a href='sok.php'>Prøv igjen</a>");
}
else
{
$result=mysql_query("SELECT *FROM media WHERE Sokord LIKE '%$search%' ORDER BY Sokord");
$letter_first= '';
if(mysql_num_rows($result) <= 0)
{
echo (mysql_num_rows($result))." Treff. <a href='sok.php'>Prøv igjen</a><br> ";
}
else
{
echo (mysql_num_rows($result))." Treff<br>";
}
while($r=mysql_fetch_assoc($result))
{
if(strtoupper(substr($r['Sokord'],0,1))!= $letter_first)
{
$letter_first= strtoupper(substr($r['Sokord'],0,1));
echo '<b>'.$letter_first.'</b><br>';
}
$Sokord=$r["Sokord"];
echo "<a href='sok_ordliste_list.php?ordliste=$Sokord'>[ $Sokord ] </a><br><br>";
}
unset($letter_first);
}
?>