<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>display associated record field for each record on list page</title>
        <link>https://interactivetools.com/forum/forum-posts.php?display-associated-record-field-for-each-record-on-list-page-82352</link>
        <description></description>
        <pubDate>Fri, 06 Mar 2026 12:49:12 -0800</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;display-associated-record-field-for-each-record-on-list-page-82352" rel="self" type="application/rss+xml" />

                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245358#post2245358</link>
          <description><![CDATA[<p>Hi all,</p>
<p>Just taking a look at this old post and noticed that there could still be unanswered questions. Do you still require assistance?</p>
<p>We'd be happy to help, please let us know.</p>]]></description>
          <pubDate>Wed, 27 Jan 2021 07:54:40 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245358#post2245358</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245206#post2245206</link>
          <description><![CDATA[<p>Good morning Deborah,</p>
<p>You're welcome.</p>
<p>I wish I could help more, but my skills in this area are limited as well.</p>
<p>Jerry Kornbluth</p>]]></description>
          <pubDate>Mon, 07 Dec 2020 07:17:28 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245206#post2245206</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245205#post2245205</link>
          <description><![CDATA[<p>Hi, Jerry.</p>
<p>That was an interesting post - thank you!</p>
<p>With my limited PHP skills, I wasn't able to adjust the code to work for my example that does not need to reference uploads. Good to know uploads can be included, though.</p>
<p>Thanks again.<br />Deborah </p>
]]></description>
          <pubDate>Mon, 07 Dec 2020 07:09:08 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245205#post2245205</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245203#post2245203</link>
          <description><![CDATA[<p>Hi Deborah,</p>
<p>Don't know if it will help, but take a look at this post.</p>
<p><a href="https://www.interactivetools.com/forum/forum-posts.php?postNum=2232753" rel="nofollow">https://www.interactivetools.com/forum/forum-posts.php?postNum=2232753</a></p>
<p>Jerry Kornbluth</p>]]></description>
          <pubDate>Sun, 06 Dec 2020 13:26:21 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245203#post2245203</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245202#post2245202</link>
          <description><![CDATA[<p>Tim, that thought occurred to me, too.</p>
<p>I'm wondering if there is a solution such as you suggested. Maybe someone will have that answer.</p>
<p>~ Deborah</p>]]></description>
          <pubDate>Sun, 06 Dec 2020 10:05:45 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245202#post2245202</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245200#post2245200</link>
          <description><![CDATA[<p>Great.  </p>
<p>My only concern is that if you have a lot of moorings, and you do a getRocords for each, it might ge quite a load.  Maybe theres a leftJoin or a mysqlselect kind of version that would be better?</p>]]></description>
          <pubDate>Sat, 05 Dec 2020 14:38:51 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245200#post2245200</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245199#post2245199</link>
          <description><![CDATA[<p>Hi, Tim.</p>
<p>Your suggestion was brilliant! I never knew it was possible to add a records call within a loop. </p>
<p>I removed the "dieWith404" because that caused a "headers already sent" error for any moorings that did not contain a maintenance record.</p>
<p>RESULTING CODE:</p>
<pre class="language-markup"><code>***** HEAD *****
  // list of moorings
  list($mooringsRecords, $mooringsMetaData) = getRecords(array(
    'tableName'   =&gt; 'moorings',
    'allowSearch' =&gt; false,
  ));


***** HTML (LIST VIEWER PG) *****
&lt;?php foreach ($mooringsRecords as $record): ?&gt;
(mooring records...)

&lt;?php // LAST INSPECTION DATE
  // load record from 'maintenance' table
  list($maintenanceRecords, $maintenanceMetaData) = getRecords(array(
    'tableName'   =&gt; 'maintenance',
    'where'       =&gt; "`num` = ".$record['num'], // match record num in 'moorings'
    'orderBy'     =&gt; "maintenance_date DESC", // get most recent
    'allowSearch' =&gt; false,
    'limit'       =&gt; '1',
  ));
  $maintenanceRecord = @$maintenanceRecords[0]; // get first record
  // if (!$maintenanceRecord) { dieWith404("Record not found!"); } // removed to avoid headers error
?&gt;

Last Inspection Date: 
&lt;?php if ($inspectionsRecord['inspection_date']): ?&gt;
&lt;?php echo date("m/d/Y", strtotime($inspectionsRecord['inspection_date'])) ?&gt;
&lt;?php endif ?&gt;

&lt;?php // end mooring records
 endforeach ?&gt;
</code></pre>
<p>Thank so much - I truly appreciate your help!<br />~ Deborah</p>]]></description>
          <pubDate>Sat, 05 Dec 2020 09:50:09 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245199#post2245199</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245198#post2245198</link>
          <description><![CDATA[<p>Hi Deborah.</p>
<p>Someone else will be able to give more expert / elegant guidance, but maybe something along the lines of this inserted within the loop?</p>
<pre class="language-markup"><code>&lt;?php
	
  // load record from 'inspections'
  list($inspectionsRecords, $inspectionsMetaData) = getRecords(array(
    'tableName'   =&gt; 'inspections',
    'where'       =&gt; "`num` = ".$record['num'],
    'loadUploads' =&gt; true,
    'allowSearch' =&gt; false,
    'limit'       =&gt; '1',
  ));
  $inspectionsRecord = @$inspectionsRecords[0]; // get first record
  if (!$inspectionsRecord) { dieWith404("Record not found!"); } // show error message if no record found
  
  echo htmlencode($inspectionsRecord['title']);

?&gt;
</code></pre>]]></description>
          <pubDate>Fri, 04 Dec 2020 15:15:58 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245198#post2245198</guid>
        </item>
                <item>
          <title>display associated record field for each record on list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245197#post2245197</link>
          <description><![CDATA[<p>Hi, Everyone. I've searched the forum extensively, but haven't found anything for this scenario and hope someone can guide me to a solution.</p>
<p>----------------------------------<br />TABLES:</p>
<p>// list of moorings<br />list($mooringsRecords, $mooringsMetaData) = getRecords(array(<br />'tableName' =&gt; 'moorings',<br />'allowSearch' =&gt; false,<br />));</p>
<p>// list of inspections records<br />list($inspectionsRecords, $inspectionsMetaData) = getRecords(array(<br />'tableName' =&gt; 'inspections',<br />'allowSearch' =&gt; false,<br />));</p>
<p>----------------------------------<br />DESIRED HTML OUTPUT on the Moorings List Viewer page:</p>
<p>&lt;?php foreach ($mooringsRecords as $record): ?&gt;<br />(the usual records for $mooringsRecords)</p>
<p><span style="color:#ff0000;">+ most recent ['inspection_date'] field from $inspectionsRecords that matches this moorings record number</span></p>
<p>&lt;?php endforeach ?&gt;</p>
<p>----------------------------------</p>
<p>The $inspections ["mooring_number"] field editor setup:</p>
<p>Field Options - Display as pulldown<br />Get options from database (advanced)<br />Section Tablename = moorings<br />Field for option values = num<br />Field for option labels = num</p>
<p>Each mooring can have multiple ["inspection_date"]s, but we only want to display the most recent date for each mooring.</p>
<p>----------------------------------</p>
<p>Hope I explained that well enough. Thanks for any help you can give!</p>
<p><br />~ Deborah</p>
]]></description>
          <pubDate>Fri, 04 Dec 2020 14:02:20 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245197#post2245197</guid>
        </item>
              </channel>
    </rss>
  