<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Link to top record only but when on the same list page</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Link-to-top-record-only-but-when-on-the-same-list-page-79033</link>
        <description></description>
        <pubDate>Tue, 14 Jul 2026 21:19:26 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Link-to-top-record-only-but-when-on-the-same-list-page-79033" rel="self" type="application/rss+xml" />

                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231973#post2231973</link>
          <description><![CDATA[<p>Hi Hannah,</p>
<p>Another options is to use the end function to get the last item from the array instead:</p>
<p><code>&lt;?php<br />// load records from 'shows'<br />list($showsRecords, $showsMetaData) = getRecords(array(<br />  'tableName' =&gt; 'shows',<br />  'loadUploads' =&gt; true,<br />  'allowSearch' =&gt; false,<br />));<br /><br />$show = end($showRecords);<br /><br />?&gt;</code></p>
<p>The end function will retrieve the last element from an array, and this avoids having to use the orderBy variable in the getRecords function.</p>
<p>Thanks!</p>
<p>Greg</p>]]></description>
          <pubDate>Fri, 27 Sep 2013 13:36:27 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231973#post2231973</guid>
        </item>
                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231965#post2231965</link>
          <description><![CDATA[<p>Hi Damon,</p>
<p>I get MySQL Error: Unknown column 'date' in 'order clause' when I use that. I though maybe that's because my fields are listed differently so tried start_date but that then just generated a random record. Then I tried changing my sort order in my CMS to include start_date but I get </p>
<p><b>Sorting Error:</b> Check your 'Order By' fields in the sorting tab for invalid field names.<br />MySQL returned the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'start_date DESC LIMIT 1' at line 1</p>
<p>Any suggestions?</p>]]></description>
          <pubDate>Fri, 27 Sep 2013 01:36:50 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231965#post2231965</guid>
        </item>
                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231956#post2231956</link>
          <description><![CDATA[<p>Hi Hannah,</p>
<p>Try adding the <span style="color:#0000ff;"><strong>orderBy </strong></span>option into the code:</p>
<p><code>&lt;?php<br />// load records from 'shows'<br />list($showsRecords, $showsMetaData) = getRecords(array(<br />  'tableName' =&gt; 'shows',<br />  'loadUploads' =&gt; true,<br />  <span style="color:#0000ff;"><strong>'orderBy'     =&gt; 'date DESC</strong>',</span><br />  'allowSearch' =&gt; false,<br />));<br /><br />$show = @$showRecords[0];<br /><br />?&gt;</code></p>
<p>This will sort it by date, newest to oldest.  You can also sort on another field if needed.</p>
<p>Hope this helps!</p>]]></description>
          <pubDate>Thu, 26 Sep 2013 10:16:59 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231956#post2231956</guid>
        </item>
                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231953#post2231953</link>
          <description><![CDATA[<p>Hi Jason,</p>
<p>That's great except it's pulling in the last record from the list and not the top!!</p>
<p>Hannah</p>]]></description>
          <pubDate>Thu, 26 Sep 2013 04:30:14 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231953#post2231953</guid>
        </item>
                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231936#post2231936</link>
          <description><![CDATA[<p>Hi Hannah,</p>
<p>What you can do is just pull the top record off of your $showRecords data set and display that like this:</p>
<p><code>&lt;?php<br />// load records from 'shows'<br />list($showsRecords, $showsMetaData) = getRecords(array(<br />  'tableName' =&gt; 'shows',<br />  'loadUploads' =&gt; true,<br />  'allowSearch' =&gt; false,<br />));<br /><br />$show = @$showRecords[0];<br /><br />?&gt;<br />&lt;a href="&lt;?php echo $show['_link'] ?&gt;" class="side"&gt;View next upcoming show &gt;&gt;&lt;/a&gt;<br /></code></p>

<p>Hope this helps</p>
]]></description>
          <pubDate>Wed, 25 Sep 2013 12:46:11 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231936#post2231936</guid>
        </item>
                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231932#post2231932</link>
          <description><![CDATA[<p>Hi Jason,</p>
<p>That's right. For all other pages:</p>
<p><span style="color:#888888;">// load records from 'shows'</span><br /><span style="color:#888888;"> list($showsRecords, $showsMetaData) = getRecords(array(</span><br /><span style="color:#888888;"> 'tableName' =&gt; 'shows',</span><br /><span style="color:#888888;"> 'limit' =&gt; '1',</span><br /><span style="color:#888888;"> 'loadUploads' =&gt; true,</span><br /><span style="color:#888888;"> 'allowSearch' =&gt; false,</span><br /><span style="color:#888888;"> ));</span></p>
<p><span style="color:#888888;">&lt;?php foreach ($showsRecords as $record): ?&gt;</span><br /><span style="color:#888888;">&lt;a class="read-more" href="&lt;?php echo $record['_link'] ?&gt;"&gt; Read more &gt;&gt;&lt;/a&gt;</span></p>
<p>and then on the list page I need the top to pull in all so:</p>
<p><span style="color:#888888;">// load records from 'shows'</span><br /><span style="color:#888888;"> list($showsRecords, $showsMetaData) = getRecords(array(</span><br /><span style="color:#888888;"> 'tableName' =&gt; 'shows',</span><br /><span style="color:#888888;"> 'loadUploads' =&gt; true,</span><br /><span style="color:#888888;"> 'allowSearch' =&gt; false,</span><br /><span style="color:#888888;"> ));</span></p>
<p><span style="color:#888888;">&lt;a href="&lt;?php echo $record['_link'] ?&gt;" class="side"&gt;View next upcoming show &gt;&gt;&lt;/a&gt;</span></p>
<p>So how would I adjust that to allow the page to display all records but the side bar link only link to the top record in that list?</p>
<p>Thank you so much for your help so far!</p>]]></description>
          <pubDate>Wed, 25 Sep 2013 01:50:42 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231932#post2231932</guid>
        </item>
                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231921#post2231921</link>
          <description><![CDATA[<p>Hi Hannah,</p>

<p>So, if I understand correctly, you have some side navigation, and one of the menu items links to the shows list page.  On the shows list page, however, you want the side bar link to go to the first show record, instead of the list page.  Is that right?  Can you show me the side navigation code you are using?</p>

<p>Thanks</p>]]></description>
          <pubDate>Tue, 24 Sep 2013 12:55:10 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231921#post2231921</guid>
        </item>
                <item>
          <title>Link to top record only but when on the same list page</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2231906#post2231906</link>
          <description><![CDATA[<p>I have a list page which has some side navigation. I want one of the links to go to the first record of that list which is fine when on other pages however when I'm on that list page how do I tell that link to specifically go to the first record as the code at the top is telling it to pull all in records. ie. </p>
<p>// load records from 'shows'<br /> list($showsRecords, $showsMetaData) = getRecords(array(<br /> 'tableName' =&gt; 'shows',<br /> 'loadUploads' =&gt; true,<br /> 'allowSearch' =&gt; false,<br /> ));</p>
<p>Thanks!</p>
<p>Hannah</p>]]></description>
          <pubDate>Tue, 24 Sep 2013 05:57:26 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2231906#post2231906</guid>
        </item>
              </channel>
    </rss>
  