?HOW-TO make nxt and previous link mysql

wxdqz

New Member
I have problem with making a next and previous page links in my database application. I am using php mysql application and that i have more than 20 hits and i wanted to divide it by 10 using two pages, or 50 using 5 page views. I hope you can lend me simple source code for that,
here is my program:

{
$hits = $db->search($KeyWords,$Media,$Heading,$Operator);
if( (!$hits) or (empty($hits)) )
{
$junk = "";
$title = "Search Results";
$msg = "No Matches";
print "<head><title></title></head><body>\n";
start_page($CatID,$msg);
} else {
$total = count($hits);
$title = "Search Results";
$msg = "Search returned $total matches";
$junk = "";

start_page($CatID,$msg);


function useColora()
{
static $ColorValue;
if($ColorValue=="#00FF00")
{
$ColorValue="#CCFFCC";
} else
{
$ColorValue="#00FF00";
}
return($ColorValue);
}

$Row = 1;
print "<table>\n";
while ( list ($key,$hit) = each ($hits))
{

if(!empty($hit))
{
$linkID = $hit["LinkID"];
$CatID = $hit["CatID"];

$CatName = stripslashes($db->get_CatNames($CatID));

$author = stripslashes($hit["author"]);
$title = stripslashes($hit["title"]);
$edition = stripslashes($hit["edition"]);
$publisher = stripslashes($hit["publisher"]);
$placePublication = stripslashes($hit["datePublication"]);
$datePublication = stripslashes($hit["placePublication"]);
$RowColor = useColora();


if($CatID==1)
{
$img = "Media_bk.gif";
} elseif ($CatID==2)
{
$img = "Media_se.gif";
} elseif ($CatID==3)
{
$img = "Media_mp.gif";
} elseif ($CatID==4)
{
$img = "Media_ms.gif";
} elseif ($CatID==5)
{
$img = "Media_mu.gif";
} elseif ($CatID==6)
{
$img = "Media_vm.gif";
} elseif ($CatID==7)
{
$img = "Media_cf.gif";
} else
{
$img = "Media_bk.gif";
}

print "<tr><td bgcolor=\"$RowColor\">&nbsp;<img src=http://www.phpbuilder.com/board/archive/index.php/\"$img\">&nbsp;$Row.&nbsp; <A HREF=\"$PHP_SELF?CatID=$CatID&view_link=$linkID\">$title / $author </a> $author. $datePublication $placePublication : $publisher ";
print "<A HREF=\"$PHP_SELF?CatID=$CatID&borrow_link=$linkID\">Borrow</A></SMALL></td></tr>\n";
$Row++;


}
}
print "</table>\n";


}

print "<P></body>\n";
exit;


}



I hope you show me some source code related to this.

<!-- w --><a class="postlink" href="http://www.polerio.f2s.com/elibrary">www.polerio.f2s.com/elibrary</a><!-- w -->
polerio
 
Back
Top