i have the follow script which is searching for news stored in mysql-database :
Code: Select all
<?
$find = $_GET['newsearch'];
$find = mysql_real_escape_string($find);
if ($find == "")
{
echo "Empty search - write a term please !"
}
else
{
$newsquery = "SELECT * FROM newslist WHERE MATCH(newsid,newstopic) AGAINST('$find*' IN BOOLEAN MODE)";
$inorder = mysql_query($newsquery) or die("Problem occured..");
$count = mysql_num_rows($inorder);
echo "<strong>Search Results</strong>";
$calcRows = mysql_num_rows($inorder);
$iterator = 0;
while ($iterator <$calcRows)
{
$theid = mysql_result($inorder, $i, "newsid");
$thetopic = mysql_result($inorder, $i, "newstopic");
echo "$newsid<p> </p>";
echo "$newstopic";
$iterator ++;
}
}
?>
<form action="news.php" method="get">
<input type="text" name="newsearch" size="100" />
<input type="submit" name="Look for news" />
</form>Can anyone give an example on how we can modify the code above so that will include pagination for our results ..!?
Thanks in advance