Hi,
Firstly i am not a programmer and any help is appreciated.
A friend of mine set this search for me, searching titles only in a mysql table for 2275 religious hymns ,works fine,But the problem is the titles contain these tags like this:
aa-ay anik janam <u>bh</u>aram sar<u>n</u>ee.
amri<u>t</u> ba<u>n</u>ee har har <u>t</u>ayree.
thus any one searching for word 'amrit' finds no results
Can the code below be modified to ignore the tags while doing the search, tags like <u></u>. And also the code be modified to show only 25 results per page and then show link for next page
This is the CODE:
<form name="frm" action="search.php">
<div align="center">
<input type="text" name="srchString">
<input type="submit" value="Go">
<strong>Search for a title </strong> </div>
</form>
</td>
</tr>
<tr>
<td>Search results for <b><i><?php echo $srchString;?>...</i></b> </td>
</tr>
<?php
$srchString=$srchString;
$allrecs=array();
getResults();
//display results onm the page
displayResults();
if(!$found){
echo "<TR><TD>No results found.</TD></TR>";
}
//function to retr. results
function getResults(){
global $found;
global $allrecs;
global $srchString;
$query="SELECT * FROM english_index WHERE eng_line LIKE '%".$srchString."%'";
$result=mysql_query($query);
if($myrow=mysql_fetch_array($result)){
$found=true;//record found.
do{
$rec["eng_id"]=$myrow["eng_id"];
$rec["eng_line"]=$myrow["eng_line"];
$rec["eng_link"]=$myrow["eng_link"];
array_push($allrecs,$rec);
}while($myrow=mysql_fetch_array($result));
}//no result found...
return $found;
}
//function that displays results
function displayResults(){
global $allrecs;
global $srchString;
disp($allrecs);
}
//function to siplay the array
function disp($arr){
global $allrecs;
foreach($allrecs as $rec){
//$rec=$allrecs[$v];
echo "<tr><td bgcolor='#eeeeee'><a href='englishindex.php?file=".$rec["eng_link"]."'><b><font face='VERDANA' size='-1'>",$rec["eng_line"],"</font></b></a></td></tr>";
}
}
?>
Thanks a lot
regards,
Manny