Page 1 of 1

Pagination Question

Posted: Sun Feb 22, 2009 7:21 pm
by jwelle
Guy, I have this code..then I want to put a pagination. please help me..^^

<?php
require_once('settings.php');
$getproducts = "SELECT NAME, PRICE, THUMBNAIL_IMAGE, SHOPPING_CART_LINK FROM `" . DBPREFIX . "flowers` WHERE EVERYDAY = 1 LIMIT 0, 24" ;
$row = $db->getRow ( $getproducts );
require_once('header.php');
?>
<div id="content_right">
<div class="product_c">
<table>
<tr>
<?
$numcols = 4;
$numcolsprinted = 0;
if ( $db->RecordCount ( $getproducts ) > 0 ) {
$cat = $db->get_results ( $getproducts );
foreach ( $cat as $row ):?>

<? if ($numcolsprinted == $numcols) {
print "</tr>\n<tr>\n";
$numcolsprinted = 0;
} ?>
<td valign="top">
<img src="<?=$row->THUMBNAIL_IMAGE?>" /><br />
<? echo "<span class='links'><a href=\"info.php?name=$row->NAME\">INFO</a></span>\n"; ?>
<a href="<?=$row->SHOPPING_CART_LINK?>">BUY</a><br />
<?=$row->NAME?><br />
<?=$row->PRICE?>
<? $numcolsprinted++; ?>
</td>
<?php endforeach; }else { echo 'No product available yet'; }
?>
</tr>
</table>
</div>
</div>
<?php require_once ('footer.php'); ?>

Re: Pagination Question

Posted: Sun Feb 22, 2009 8:25 pm
by Bill H
Do a search of the forums for "pagination." This topis has been discussued at great length.