Pagination Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jwelle
Forum Newbie
Posts: 1
Joined: Sun Feb 22, 2009 7:18 pm

Pagination Question

Post 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'); ?>
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: Pagination Question

Post by Bill H »

Do a search of the forums for "pagination." This topis has been discussued at great length.
Post Reply