i am trying to set up a recordset that searches through records. when i set up the recordset paging to show 5 records at the time i only see the first 5 records and after that (when i move to the second, third,... page) i can only see the previous | next links... any suggestions? the variables are passed from previous page via post method
here is the code i am using:
<?php require_once('Connections/happyacs_acs.php'); ?>
<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];
$maxRows_rsItemCode = 5;
$pageNum_rsItemCode = 0;
if (isset($HTTP_GET_VARS['pageNum_rsItemCode'])) {
$pageNum_rsItemCode = $HTTP_GET_VARS['pageNum_rsItemCode'];
}
$startRow_rsItemCode = $pageNum_rsItemCode * $maxRows_rsItemCode;
//$manuf_rsItemCode = "1";
if (isset($manuf)) {
$manuf_rsItemCode = (get_magic_quotes_gpc()) ? $manuf : addslashes($manuf);
}
//$categ_rsItemCode = "1";
if (isset($categ)) {
$categ_rsItemCode = (get_magic_quotes_gpc()) ? $categ : addslashes($categ);
}
mysql_select_db($database_happyacs_acs, $happyacs_acs);
$query_rsItemCode = sprintf("SELECT products.itemCode, products.Description, products.salesUnitSize, products.salesUnitName, manufacturer.manufName, products.manufID FROM products INNER JOIN manufacturer ON products.manufID = manufacturer.manufID INNER JOIN category ON products.categoryID = category.catID WHERE products.manufID = %s AND products.categoryID = %s", $manuf_rsItemCode,$categ_rsItemCode);
$query_limit_rsItemCode = sprintf("%s LIMIT %d, %d", $query_rsItemCode, $startRow_rsItemCode, $maxRows_rsItemCode);
$rsItemCode = mysql_query($query_limit_rsItemCode, $happyacs_acs) or die(mysql_error());
$row_rsItemCode = mysql_fetch_assoc($rsItemCode);
if (isset($HTTP_GET_VARS['totalRows_rsItemCode'])) {
$totalRows_rsItemCode = $HTTP_GET_VARS['totalRows_rsItemCode'];
} else {
$all_rsItemCode = mysql_query($query_rsItemCode);
$totalRows_rsItemCode = mysql_num_rows($all_rsItemCode);
}
$totalPages_rsItemCode = ceil($totalRows_rsItemCode/$maxRows_rsItemCode)-1;
$queryString_rsItemCode = "";
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_rsItemCode") == false &&
stristr($param, "totalRows_rsItemCode") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_rsItemCode = "&" . implode("&", $newParams);
}
}
$queryString_rsItemCode = sprintf("&totalRows_rsItemCode=%d%s", $totalRows_rsItemCode, $queryString_rsItemCode);
?>