Jump to content

first record repeated on each page in a page set


mishasoni

Recommended Posts

Hello there!  :) Hoping for some help.  I have a repeat region set up that displays 8 records per page, ordered by 'DatePublished" DESC.  Until recently all was working fine. Now suddenly the first (most recent) record repeats at the top of each page in the page set.  For the life of me I can't figure out why this is happening.  ??? My relevant code is below.  You can view the page in action at http://www.agci.org/programs/public_lecture_series/publicLecture_results.php.

Any help would be greatly appreciated – please let me know if I need to provide more details.  Thanks in advance.

 

Recordset:

<?php 
mysql_select_db($database_AGCI, $AGCI);
$query_rsPubLecSearch = "SELECT Events.Name, Library.AgendaPresenterAgendaItemID_AgPrst_PresenterNameFirst, Library.AgendaPresenterAgendaItemID_AgPrst_PresenterNameLast, Library.AgendaPresenterAgendaItemID_AgPrst_ContactID_fk, Events.Description, Library.DatePublished, Events.Evt_thumbRedirect, Events.Notes, Library.Keywords, Events.EventCode, Events.EventTopic, Events.EventTopic2, Events.EventTopic3, Events.EventTopic4, Events.EventTopic5, Events.EventTopic6,  Events.EventTopic7, Library.DocPDF1WEB, Library.InternetCode, Library.Video_Auth FROM Events, Library WHERE Events.EventType LIKE 'Walter Orr Roberts' AND Library.EventCode  = Events.EventCode ORDER BY Library.DatePublished DESC";
setQueryBuilderSource($query_rsPubLecSearch,$PublicLecture_Search,false);
$rsPubLecSearch = mysql_query($query_rsPubLecSearch, $AGCI) or die(mysql_error());
$row_rsPubLecSearch = mysql_fetch_assoc($rsPubLecSearch);
$totalRows_rsPubLecSearch = mysql_num_rows($rsPubLecSearch);
$maxRows_rsPubLecSearch = 8;
$pageNum_rsPubLecSearch = 0;
if (isset($_GET['pageNum_rsPubLecSearch'])) {
  $pageNum_rsPubLecSearch = $_GET['pageNum_rsPubLecSearch'];
}
$startRow_rsPubLecSearch = $pageNum_rsPubLecSearch * $maxRows_rsPubLecSearch;

mysql_select_db($database_AGCI, $AGCI);

$query_limit_rsPubLecSearch = sprintf("%s LIMIT %d, %d", $query_rsPubLecSearch, $startRow_rsPubLecSearch, $maxRows_rsPubLecSearch);
$rsPubLecSearch = mysql_query($query_limit_rsPubLecSearch, $AGCI) or die(mysql_error());
$row_rsPubLecSearch_rsPubLecSearch = mysql_fetch_assoc($rsPubLecSearch);

if (isset($_GET['totalRows_rsPubLecSearch'])) {
  $totalRows_rsPubLecSearch = $_GET['totalRows_rsPubLecSearch'];
} else {
  $all_rsPubLecSearch = mysql_query($query_rsPubLecSearch);
  $totalRows_rsPubLecSearch = mysql_num_rows($all_rsPubLecSearch);
}
$totalPages_rsPubLecSearch = ceil($totalRows_rsPubLecSearch/$maxRows_rsPubLecSearch)-1;
$queryString_rsPubLecSearch = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_rsPubLecSearch") == false && 
        stristr($param, "totalRows_rsPubLecSearch") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_rsPubLecSearch = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_rsPubLecSearch = sprintf("&totalRows_rsPubLecSearch=%d%s", $totalRows_rsPubLecSearch, $queryString_rsPubLecSearch);

?>

 

 

Page Body:

<?php do { ?>
              <table class="repeatRegion" width="513" border="0">
                <tr>
                  <td colspan="4" > </td>
                </tr>
                <tr>
                  <td colspan="2"><h3><a href="http://www.agci.org/programs/public_lecture_series/about_the_lecture/publicLecture_details.php?recordID=<?php echo $row_rsPubLecSearch['EventCode']; ?>"/><?php echo $row_rsPubLecSearch['Name']; ?></a></h3></td>
                  <td width="22" rowspan="5"> </td>
                  <td width="108" rowspan="5" align="right" valign="top"><a href="http://www.agci.org/programs/public_lecture_series/about_the_lecture/publicLecture_details.php?recordID=<?php echo $row_rsPubLecSearch['EventCode']; ?>"><img src="http://www.agci.org/dB/Thumbnails/<?php echo $row_rsPubLecSearch['Evt_thumbRedirect']; ?>" alt="event image" width="100" border="2" align="right" id="eventImage" /></a> </td>
                </tr>
                <tr>
                  <td colspan="2"><span class="green_dim">Speaker: Dr. <?php echo $row_rsPubLecSearch['AgendaPresenterAgendaItemID_AgPrst_PresenterNameFirst']; ?> <?php echo $row_rsPubLecSearch['AgendaPresenterAgendaItemID_AgPrst_PresenterNameLast']; ?></span> <br />
                        <?php $dateChunks = explode("-", $row_rsPubLecSearch['DatePublished']); // explode date ?>
                        <?php $Y= "$dateChunks[0]";?>
                        <?php $M= "$dateChunks[1]";?>
                        <?php $D= "$dateChunks[2]";?>
                        <?php $d_var1=getdate(mktime(0,0,0,$M,$D,$Y)); // reformat date ?>
                        <span class="fineprint">Presented on <?php echo $d_var1[mday]?> <?php echo $d_var1[month]?> <?php echo $d_var1[year] // print new date output?></span> </td>
                </tr>
                <tr>
                  <td colspan="2"> </td>
                </tr>
                <tr>
                  <td colspan="2"><?php echo $row_rsPubLecSearch['Description']; ?>  <a href="http://www.agci.org/programs/public_lecture_series/about_the_lecture/publicLecture_details.php?recordID=<?php echo $row_rsPubLecSearch['EventCode']; ?>"/>View</a> <a href="http://www.agci.org/programs/public_lecture_series/about_the_lecture/publicLecture_details.php?recordID=<?php echo $row_rsPubLecSearch['EventCode']; ?>"/><img src="http://www.agci.org/images/bullet_doublearrow.gif" alt="double arrow" border="0" /></a></td>
                </tr>
                <tr>
                  <td colspan="2"> </td>
                </tr>
              </table>
              <?php } while ($row_rsPubLecSearch = mysql_fetch_assoc($rsPubLecSearch)); ?>
          </div>
            <p> </p>

<table width="513" height="20" border="0">
  <tr bgcolor="#666666"><td height="5" colspan = "2" >  </td>
  </tr>
  <tr>
    <td>

  <?php if ($pageNum_rsPubLecSearch > 0) { // Show if not first page ?>
   <a href="<?php printf("%s?pageNum_rsPubLecSearch=%d%s", $currentPage, 0, $queryString_rsPubLecSearch); ?>"><< First</a>
  <?php } // Show if not first page ?>
  
<?php if ($pageNum_rsPubLecSearch > 0) { // Show if not first page ?>
  <a href="<?php printf("%s?pageNum_rsPubLecSearch=%d%s", $currentPage, max(0, $pageNum_rsPubLecSearch - 1), $queryString_rsPubLecSearch); ?>">< Previous</a>   
  <?php } // Show if not first page ?></td>
    
    <td><div align="right">
      <?php if ($pageNum_rsPubLecSearch < $totalPages_rsPubLecSearch) { // Show if not last page ?>
        <a href="<?php printf("%s?pageNum_rsPubLecSearch=%d%s", $currentPage, min($totalPages_rsPubLecSearch, $pageNum_rsPubLecSearch + 1), $queryString_rsPubLecSearch); ?>">Next ></a>  
        <?php } // Show if not last page ?>
      <?php if ($pageNum_rsPubLecSearch < $totalPages_rsPubLecSearch) { // Show if not last page ?>
        <a href="<?php printf("%s?pageNum_rsPubLecSearch=%d%s", $currentPage, $totalPages_rsPubLecSearch, $queryString_rsPubLecSearch); ?>">Last >></a>
        <?php } // Show if not last page ?>
      
</div>



      <?php } // Show if recordset not empty ?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.