I have the lyrics in database and also on static pages.
I have this code now
Code:
$resulttsearch22=mysql("db_name","select ID,Text from lyrics");
$num_cautari2=mysql_num_rows($resulttsearch22);
for ($c=0;$c<$num_cautari2;$c++)
{
$relevancy=0;
$row=mysql_fetch_object($resulttsearch22);
$mypage=$row->ID;
$mycontent=strtolower(strip_tags($row->Text));
for ($d=0; $d<$q_num; $d++)
{$liungimeasasa=strlen($q_array[$d]);
if ($liungimeasasa>2)
{
$mycontent=substr($mycontent, 0,1000);
$relevancy+=substr_count($mycontent, strtolower($q_array[$d]));
}
}//end of for
if ($relevancy>0)
$res["$mypage"]=$relevancy;
if (count($res)>0)
arsort ($res);
}
Bookmarks