Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Passing Record Count From Master Page Detail Set

New Here ,
Jul 31, 2009 Jul 31, 2009

Copy link to clipboard

Copied

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

TOPICS
Server side applications

Views

757
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 01, 2009 Aug 01, 2009

Copy link to clipboard

Copied

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-->

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2009 Aug 01, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2009 Aug 01, 2009

Copy link to clipboard

Copied

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)); ?>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 01, 2009 Aug 01, 2009

Copy link to clipboard

Copied

Heya,

On thumbnail.php page your records are numbered starting with "1" but in landscape_photography.php your images are filtered down to "0"

This leads me to believe you have a filtered recordset on landscape_photography.php to filter the images based on URL parameter against a table field with image number. It appears as though the table field that contains the image number that is filtered against URL parameter is starting with "0" instead of "1"

To fix this go to your database and for the table field that has the image number change the numbers so that they are numbered stating at "1" instead of "0" this will fix the relation between URL parameter being sent on thumbnail.php page to filtered recordset on landscape_photography.php where URL parameter = the table field for image number.

Hope that helps!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2009 Aug 01, 2009

Copy link to clipboard

Copied

LATEST

Hey www.DwFAQ.info it works! I can't tell you how stoked I am right now. Thanks for all your help and patience. Take care, ~ JD

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines