Skip to main content
July 31, 2009
Question

Passing Record Count From Master Page Detail Set

  • July 31, 2009
  • 1 reply
  • 808 views

Hi there. I am building a photo gallery and I would like the user to click on a thumbnail in group, go to the detail page to show the larger image. That works fine, however the record count is always 1/0 instead of 4/20, 7/20, etc. My suspicion is that I need to pass some sort of variable that I am unaware of. Any feedback is greatly needed and appreciated.

Here is the link to the thumbnail gallery

http://blackbird.dominguezstudio.com/landscape_photography_thumbs.php

Here is the code I am using for this

<div id="content">
    <div id="thumbHeader"><?php include("includes/landscapeThumbHeader.php"); ?></div>
            <?php do { ?>
                    <a href="landscape_photography.php?recordID=<?php echo $row_rsLandscape['record']; ?>"> <img src="../07landscape/<?php echo $row_rsLandscape['th_filename']; ?>"></a>
            <?php } while ($row_rsLandscape = mysql_fetch_assoc($rsLandscape)); ?>
    <?php echo $totalRows_rsLandscape ?> Records Total
</div><!--close content-->

I'm using CS3. Thanks, ~ JD

This topic has been closed for replies.

1 reply

DwFAQ
Participating Frequently
August 1, 2009

Here is the code I am using for this

<div id="content">
    <div id="thumbHeader"><?php include("includes/landscapeThumbHeader.php"); ?></div>
            <?php do { ?>
                    <a href="landscape_photography.php?
recordID=<?php echo $row_rsLandscape['record']; ?>"> <img src="../07landscape/<?php echo $row_rsLandscape['th_filename']; ?>"></a>
            <?php } while ($row_rsLandscape = mysql_fetch_assoc($rsLandscape)); ?>
    <?php echo $totalRows_rsLandscape ?> Records Total

</div><!--close content-->

No you're not. You're using a dynamically-generated URL parameter imageID, not recordID.  From the looks of it you need to put the URL parameter pageNum_rsLandscapeDetail instead of imageID and change the recordset binding for the URL parameter to reflect the same info from the recordset LandscapeDetail on landscape_photography.php

So on thumbnail page create a filtered recordset for LandscapeDetail images and display row in dynamic URL parameter repeat region. That will get all landscape images from the filtered recordset and display URL parameters based on row number of landscape images. so you'll get URL's landscape_photography.php?pageNum_rsLandscapeDetail=1 - 2 -3 etc. for 1st 2nd 3rd thumbnail images etc. and they will display correct record order in landscape_photography.php

<div id="content">
    <div id="thumbHeader"><?php include("includes/landscapeThumbHeader.php"); ?></div>
            <?php do { ?>
                    <a href="landscape_photography.php?pageNum_rsLandscapeDetail=<?php echo $row_rssomething['something']; ?>"> <img src="../07landscape/<?php echo $row_rsLandscape['th_filename']; ?>"></a>
            <?php } while ($row_rsLandscape = mysql_fetch_assoc($rsLandscape)); ?>
    <?php echo $totalRows_rsLandscape ?> Records Total
</div><!--close content-->
August 1, 2009

Thanks www.DwFAQ.info for taking the time. I will give this a shot and let you know. That sounds totally logical. I just didn't know how to visualize the data flow. Talk soon, ~ JD

August 1, 2009

Thanks www.DwFAQ.info. Your advice was awesome! I have it almost working. I created a unique table with only landscape images and have my recordset showing all on the thumbs page and one at a time on the detail page (landscape_photography.php).


If you would go to the link you will notice that the record count is always one more than the actual record. My guess is that it has something to do with the pageNum in the display record count.

http://blackbird.dominguezstudio.com/landscape_photography_thumbs.php

I'm close. I can feel it. Thanks in advance for your help. ~ JD

<!--code from landscape_photography_thumbs.php-->

   <?php do { ?>
             <a href="landscape_photography.php?pageNum_rsLandscapeDetail=<?php echo $row_rsLandscapeDetail['ID']; ?>"><img src="../07landscape/<?php echo $row_rsLandscapeDetail['th_filename']; ?>"></a>
    <?php } while ($row_rsLandscapeDetail = mysql_fetch_assoc($rsLandscapeDetail)); ?>





<!--code from landscape_photography.php-->

<?php do { ?>
        <div id="content">

               <img src="../07landscape/<?php echo $row_rsLandscapeDetail['filename']; ?>" alt="<?php include("includes/landscapeAlt.php"); ?>">
                <div class="fltLeftClrLeft">

                         <a href="<?php printf("%s?pageNum_rsLandscapeDetail=%d%s", $currentPage, max(0, $pageNum_rsLandscapeDetail - 1), $queryString_rsLandscapeDetail); ?>"><img src="images/arrowLh.gif" border=0></a>

                         <span class="total"><?php echo ($startRow_rsLandscapeDetail + 1) ?>/ <?php echo $totalRows_rsLandscapeDetail ?> </span>
                          <a href="<?php printf("%s?pageNum_rsLandscapeDetail=%d%s", $currentPage, min($totalPages_rsLandscapeDetail, $pageNum_rsLandscapeDetail + 1), $queryString_rsLandscapeDetail); ?>"><img src="images/arrowRh.gif" border=0></a>

                         <a href="landscape_photography_thumbs.php">thumbnails</a>

               </div><!--end fltLftClrLft-->
         </div><!--end content-->
<?php } while ($row_rsLandscapeDetail = mysql_fetch_assoc($rsLandscapeDetail)); ?>