We help IT Professionals succeed at work.
Get Started

Dreamweaver Navigation Bar Problem

Last Modified: 2012-05-07
HI,  I am fairly new to Dreamweaver CS3 and dynamic websites, I have been working non-stop this week and have several record sets set up and they are dynamically populating tables wth repeat region data from a PHP/MySQL database.

When I display an entire record set the records display correctly.

My problem is when I use a (text field) filter within Dreamweaver (currently single parameter) to define the recordset I want to display in my dynamic table the first page loads pefectly but using the navigation bar "forward arrow" the second page loads but the table results are empty.  And any subsequent forward/back arrow usage means empty tables as well.

I think this is because the variable I define as my text field (i.e. search term) to populate the table is not carrying over to the second page (via the nav button), any heplp on this issue wuld be much appreciated
Thank you in advance for any help offered
<?php require_once('Connections/connRecord.php'); ?>
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_rsSearchResults = 40;
$pageNum_rsSearchResults = 0;
if (isset($_GET['pageNum_rsSearchResults'])) {
  $pageNum_rsSearchResults = $_GET['pageNum_rsSearchResults'];
$startRow_rsSearchResults = $pageNum_rsSearchResults * $maxRows_rsSearchResults;
$colname_rsSearchResults = "-1";
if (isset($_POST['search'])) {
  $colname_rsSearchResults = (get_magic_quotes_gpc()) ? $_POST['search'] : addslashes($_POST['search']);
mysql_select_db($database_connRecordGuide, $connRecordGuide);
$query_rsSearchResults = sprintf("SELECT `PRIMARY`, fld_artist_key, fld_title, fld_catalogue, fld_value_08 FROM tbl_albums WHERE fld_artist_key LIKE '%%%s%%'", $colname_rsSearchResults);
$query_limit_rsSearchResults = sprintf("%s LIMIT %d, %d", $query_rsSearchResults, $startRow_rsSearchResults, $maxRows_rsSearchResults);
$rsSearchResults = mysql_query($query_limit_rsSearchResults, $connRecordGuide) or die(mysql_error());
$row_rsSearchResults = mysql_fetch_assoc($rsSearchResults);
if (isset($_GET['totalRows_rsSearchResults'])) {
  $totalRows_rsSearchResults = $_GET['totalRows_rsSearchResults'];
} else {
  $all_rsSearchResults = mysql_query($query_rsSearchResults);
  $totalRows_rsSearchResults = mysql_num_rows($all_rsSearchResults);
$totalPages_rsSearchResults = ceil($totalRows_rsSearchResults/$maxRows_rsSearchResults)-1;
$queryString_rsSearchResults = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_rsSearchResults") == false && 
        stristr($param, "totalRows_rsSearchResults") == false) {
      array_push($newParams, $param);
  if (count($newParams) != 0) {
    $queryString_rsSearchResults = "&" . htmlentities(implode("&", $newParams));
$queryString_rsSearchResults = sprintf("&totalRows_rsSearchResults=%d%s", $totalRows_rsSearchResults, $queryString_rsSearchResults);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="Accessible_Design.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	background-color: #000000;
.style2 {color: #FFFFFF}
.style3 {color: #FF0000}
.style4 {color: #FF0000; font-size: small; }
<body class="BodyBackgroundColor">
<img src="spacer.gif" alt="Skip to Content" width="1" height="1" />
<table width="100%" border="0" cellpadding="4" cellspacing="0">
    <td height="114" class="HeaderColor style2"><img src="" alt=" Thumbnail Image" name="image" width="100" height="81" id="image" /></td>
    <td width="100%" class="HeaderColor style2"><table width="573" border="1" cellpadding="2" cellspacing="1" bordercolor="#FF0000">
      <tr valign="bottom" bordercolor="#FF0000">
        <td width="573" class="NavigationBackgroundColor" style="text-align: center"><a href="rrpg_advsearch.html" class="style4">Advanced Search </a> </td>
        <td width="573" class="NavigationBackgroundColor" style="text-align: center"><a href="rrpg_forums.html" class="style4">Forums</a> </td>
        <td width="573" class="NavigationBackgroundColor" style="text-align: center"><a href="rrpg_grading.html" class="style4">Grading/Glossary</a> </td>
        <td width="573" class="NavigationBackgroundColor" style="text-align: center"><a href="rrpg_faq.html" class="style4">FAQ</a> </td>
        <td width="573" class="NavBackgroundColor" style="text-align: center"><a href="rrpg_contactus.html" class="style4">Contact Us </a> </td>
        <table width="573" height="25" border="1" bordercolor="#FF0000">
          <tr align="left" valign="top">
            <th width="263" height="38" scope="col"><div align="left">
                <form id="searchart" name="searchart" method="get" action="rrpg_results.php">
                  <label for="textfield"></label>
                  <input type="text" name="search" id="search" />
                  <label for="Submit"></label>
                  <input type="submit" name="Submit" value="Go" id="Submit" />
            <th width="257" scope="col"><form id="searchtit" name="searchtit" method="post" action="rrpg_resultstit.php">
                <label for="label"></label>
              <input type="text" name="searchtitle" id="label" />
              <label for="label2"></label>
              <input type="submit" name="Submit2" value="Go" id="label2" />
<p class="style2">&nbsp;</p>
<table border="1" cellpadding="2" cellspacing="2">
  <tr align="center" valign="top">
    <td height="25"><span class="style2 style2 style3">Record No. </span></td>
    <td height="25"><span class="style3">Artist Key </span></td>
    <td height="25"><span class="style3">Title</span></td>
    <td height="25"><span class="style3">Catalogue</span></td>
    <td height="25"><span class="style2">Value</span></td>
  <?php do { ?>
      <td><span class="style2"><a href="rrpg_detail.php?recordID=<?php echo $row_RsRecordTable['PRIMARY']; ?>"><?php echo $row_rsSearchResults['PRIMARY']; ?></a></span></td>
      <td><span class="style2"><?php echo $row_rsSearchResults['fld_artist_key']; ?></span></td>
      <td><span class="style2"><?php echo $row_rsSearchResults['fld_title']; ?></span></td>
      <td><span class="style2"><?php echo $row_rsSearchResults['fld_catalogue']; ?></span></td>
      <td><span class="style2"><?php echo $row_rsSearchResults['fld_value_08']; ?></span></td>
    <?php } while ($row_rsSearchResults = mysql_fetch_assoc($rsSearchResults)); ?>
<p class="style2"> Records <?php echo ($startRow_rsSearchResults + 1) ?> to <?php echo min($startRow_rsSearchResults + $maxRows_rsSearchResults, $totalRows_rsSearchResults) ?> of <?php echo $totalRows_rsSearchResults ?>
<table border="0" width="50%" align="center">
    <td width="23%" align="center"><?php if ($pageNum_rsSearchResults > 0) { // Show if not first page ?>
        <a href="<?php printf("%s?pageNum_rsSearchResults=%d%s", $currentPage, 0, $queryString_rsSearchResults); ?>"><img src="First.gif" border=0></a>
        <?php } // Show if not first page ?>
    <td width="31%" align="center"><?php if ($pageNum_rsSearchResults > 0) { // Show if not first page ?>
        <a href="<?php printf("%s?pageNum_rsSearchResults=%d%s", $currentPage, max(0, $pageNum_rsSearchResults - 1), $queryString_rsSearchResults); ?>"><img src="Previous.gif" border=0></a>
        <?php } // Show if not first page ?>
    <td width="23%" align="center"><?php if ($pageNum_rsSearchResults < $totalPages_rsSearchResults) { // Show if not last page ?>
        <a href="<?php printf("%s?pageNum_rsSearchResults=%d%s", $currentPage, min($totalPages_rsSearchResults, $pageNum_rsSearchResults + 1), $queryString_rsSearchResults); ?>"><img src="Next.gif" border=0></a>
        <?php } // Show if not last page ?>
    <td width="23%" align="center"><?php if ($pageNum_rsSearchResults < $totalPages_rsSearchResults) { // Show if not last page ?>
        <a href="<?php printf("%s?pageNum_rsSearchResults=%d%s", $currentPage, $totalPages_rsSearchResults, $queryString_rsSearchResults); ?>"><img src="Last.gif" border=0></a>
        <?php } // Show if not last page ?>
first page ?>

Open in new window

Watch Question
Don't talk to me.
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE