<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>displayed records not matching total records</title>
        <link>https://interactivetools.com/forum/forum-posts.php?displayed-records-not-matching-total-records-82524</link>
        <description></description>
        <pubDate>Sun, 14 Jun 2026 09:41:54 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;displayed-records-not-matching-total-records-82524" rel="self" type="application/rss+xml" />

                <item>
          <title>displayed records not matching total records</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245905#post2245905</link>
          <description><![CDATA[<p>Hey Craig,</p>
<p>Thanks for the update - that definitely explains the issue. Glad you were able to figure it out!</p>
<p>Cheers,</p>]]></description>
          <pubDate>Tue, 29 Mar 2022 13:58:04 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245905#post2245905</guid>
        </item>
                <item>
          <title>displayed records not matching total records</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245902#post2245902</link>
          <description><![CDATA[<p>Hey Daniel - </p>
<p>Nevermind - I am too clever for my own good apparently.  I found the issue. The menu system goes out to check and see if there are records to be displayed before it makes the menu option a choice. </p>
<p>Thanks for your wilingness to jump in with me!</p>
<p>Regards,</p>
<p>Craig</p>]]></description>
          <pubDate>Tue, 29 Mar 2022 06:24:52 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245902#post2245902</guid>
        </item>
                <item>
          <title>displayed records not matching total records</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245901#post2245901</link>
          <description><![CDATA[<p>you are right!  see below - still not sure why the #5 records show up in the foreach loop</p>

<p>SELECT SQL_CALC_FOUND_ROWS `x_news`.*<br />FROM `cms_x_news` as `x_news`<br />WHERE (blog_category = '1') <br />ORDER BY `post_date` DESC<br />SELECT * FROM `cms_uploads` WHERE tableName = 'x_news' AND<br />fieldName IN ('photo') AND<br />recordNum IN (64,63,59,58,47,40,38,39,33,31,21,20,14)<br />ORDER BY `order`, num<br />SELECT SQL_CALC_FOUND_ROWS `accounts`.*<br />FROM `cms_accounts` as `accounts`<br />WHERE (`num` IN (29,26,1,18)) <br />ORDER BY fullname, username<br />SELECT SQL_CALC_FOUND_ROWS `members`.*<br />FROM `cms_members` as `members`<br />WHERE (`num` IN (29,26,1,18)) <br />ORDER BY user_fname ASC<br />SELECT * FROM `cms_uploads` WHERE tableName = 'members' AND<br />fieldName IN ('photo') AND<br />recordNum IN (1)<br />ORDER BY `order`, num<br /># records 13 </p>]]></description>
          <pubDate>Mon, 28 Mar 2022 17:19:06 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245901#post2245901</guid>
        </item>
                <item>
          <title>displayed records not matching total records</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245900#post2245900</link>
          <description><![CDATA[<p>Hey craig,</p>
<p>I think this is a different issue than in the first post - your "where" syntax is a bit off. This:</p>
<pre class="language-php"><code>'where' =&gt; "'blog_category' = 1",</code></pre>
<p>Should be this:</p>
<pre class="language-php"><code>'where' =&gt; "blog_category = '1'",</code></pre>
<p>This is likely the reason it's returning 0 records at the moment, but in your first post the syntax is correct and it's returning records - just the wrong ones. Try correcting the above issue, but also feel free to send a support request: <a href="https://www.interactivetools.com/support/request/" rel="nofollow">https://www.interactivetools.com/support/request/</a></p>
<p>Include the FTP connection details and the location of your test file - I should be able to quickly go in and run a few tests to help troubleshoot the initial issue.</p>
<p>Thanks,</p>]]></description>
          <pubDate>Mon, 28 Mar 2022 17:12:21 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245900#post2245900</guid>
        </item>
                <item>
          <title>displayed records not matching total records</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245898#post2245898</link>
          <description><![CDATA[<p>Hey Daniel - </p>
<p>Thanks for the help - well I don't know how to explain this but here are the debug results  and i  posted the whole page code below.  Also I took a screenshot of the x_news table in the database and you can see there are records with blog_category = 1</p>
<p>Please let me know if you need anything else. </p>
<p>thanks!</p>
<p>craig</p>
<p>SELECT SQL_CALC_FOUND_ROWS `x_news`.*<br />FROM `cms_x_news` as `x_news`<br />WHERE ('blog_category' = 1) <br />ORDER BY `post_date` DESC<br /># records 0</p>
<p>++++++++++++++++++++++++++++++++++</p>

<p>&lt;?php header('Content-type: text/html; charset=utf-8'); ?&gt;<br />&lt;?php<br />// $blog_where = "";<br />// $blog_where = "1";<br />$blog_rec = "";<br /><br />$libraryPath = 'cmsb/lib/viewer_functions.php';<br />$dirsToCheck = array('/home/xanitoshqadmin/public_html/','','../','../../','../../../');<br />foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}<br />if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }</p>
<p>list($x_sec_introRecords, $x_sec_introMetaData) = getRecords(array(<br />'tableName' =&gt; 'x_sec_intro',<br />'where' =&gt; "`sn` = 'bed'",<br />'loadUploads' =&gt; true,<br />'allowSearch' =&gt; false,<br />'limit' =&gt; '1',<br />));<br />$x_sec_introRecord = @$x_sec_introRecords[0]; // get first record<br />if (!$x_sec_introRecord) { dieWith404("Record not found!"); } // show error message if no record found</p>
<p>list($x_newsRecords, $x_newsMetaData) = getRecords(array(<br />'tableName' =&gt; 'x_news',<br />'loadUploads' =&gt; true,<br />'allowSearch' =&gt; false,<br />'where' =&gt; "'blog_category' = 1",<br />'orderBy' =&gt; "`post_date` DESC",<br />'debugSql' =&gt; true,<br />));<br />?&gt;&lt;!DOCTYPE html&gt;<br />&lt;!--[if IE 8]&gt; &lt;html class="ie ie8"&gt; &lt;![endif]--&gt;<br />&lt;!--[if IE 9]&gt; &lt;html class="ie ie9"&gt; &lt;![endif]--&gt;<br />&lt;!--[if gt IE 9]&gt;&lt;!--&gt; &lt;html&gt; &lt;!--&lt;![endif]--&gt;<br />&lt;head&gt;<br />&lt;title&gt;&lt;?php echo htmlencode($x_sec_introRecord['title']) ?&gt;&lt;?php include("core-title-tag.php"); ?&gt;&lt;/title&gt;<br />&lt;meta name="description" content="&lt;?php include("core-description-tag.php"); ?&gt;"&gt;<br />&lt;meta name="keywords" content="&lt;?php echo htmlencode($x_sec_introRecord['keywords']) ?&gt;"&gt;</p>
<p>&lt;?php include("core-head.php"); ?&gt;<br /><br />&lt;style&gt; <br />.nav-tabs &gt; li &gt; a {<br />font-family: 'Raleway','Open Sans',Arial,Helvetica,sans-serif;<br />font-weight: 600;<br />}<br />.blog-post-item {<br />background-color: rgba(0,0,0,0.05);<br />padding: 10px; <br />}<br />&lt;/style&gt; <br />&lt;?php include("core-analytics.php"); ?&gt;<br />&lt;?php <br />$blog_rec = $x_newsMetaData['totalRecords'];<br />echo ' # records '. $blog_rec;?&gt;<br />&lt;/head&gt;</p>
<p><br />&lt;body class="smoothscroll enable-animation"&gt;<br />&lt;!-- wrapper --&gt;<br />&lt;div id="wrapper"&gt;</p>
<p>&lt;!-- Top Bar --&gt;<br />&lt;?php include("core-top-navigation.php"); ?&gt;<br />&lt;!-- /Top Bar --&gt;</p>
<p>&lt;div id="header" class="sticky clearfix"&gt;<br />&lt;!-- TOP NAV --&gt;<br />&lt;?php include("core-main-navigation.php"); ?&gt;<br />&lt;!-- /Top Nav --&gt;<br />&lt;/div&gt;</p>
<p>&lt;section class="page-header page-header-xs shadow-after-3"&gt;<br />&lt;div class="container"&gt;</p>
<p>&lt;h1&gt;&lt;?php echo htmlencode($x_sec_introRecord['title']) ?&gt; | &lt;span class="size-16"&gt;&lt;?php echo htmlencode($x_sec_introRecord['slogan']) ?&gt;&lt;/span&gt;&lt;/h1&gt;</p>
<p>&lt;!-- breadcrumbs --&gt;<br />&lt;ol class="breadcrumb"&gt;<br />&lt;li&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;<br />&lt;/ol&gt;&lt;!-- /breadcrumbs --&gt;</p>
<p>&lt;/div&gt;<br />&lt;/section&gt;<br />&lt;!-- /PAGE HEADER --&gt;<br />&lt;!-- MAIN INFORMATION --&gt;<br />&lt;section&gt;<br />&lt;div class="container"&gt;<br />&lt;?php // echo $GLOBALS["blog_cat"] ;?&gt;<br />&lt;div id="blog" class="clearfix blog-isotope blog-isotope-3"&gt;</p>
<p>&lt;?php foreach ($x_newsRecords as $record): ?&gt;<br />&lt;!-- POST ITEM --&gt;<br />&lt;div class="blog-post-item"&gt;<br />&lt;!-- IMAGE --&gt;<br />&lt;?php foreach ($record['photo'] as $index =&gt; $upload): ?&gt;<br />&lt;figure class="margin-bottom-20"&gt;<br />&lt;img class="img-responsive" src="assets/images/cmsb/&lt;?php echo htmlencode($upload['filename']) ?&gt;" alt="&lt;?php echo htmlencode($upload['info1']) ?&gt; | www.xanitos.com"&gt;<br />&lt;/figure&gt;<br />&lt;?php endforeach ?&gt;</p>
<p>&lt;h2&gt;&lt;a href="&lt;?php echo $record['_link'] ?&gt;"&gt;&lt;?php echo htmlencode($record['title']) ?&gt;&lt;/a&gt;&lt;/h2&gt;</p>
<p>&lt;ul class="blog-post-info list-inline margin-bottom-0 padding-bottom-10"&gt;<br />&lt;li&gt;<br />&lt;i class="fa fa-clock-o"&gt;&lt;/i&gt; <br />&lt;span class="font-lato"&gt;&lt;?php echo date("F j, Y", strtotime($record['post_date'])) ?&gt;&lt;/span&gt;<br />&lt;/li&gt;<br />&lt;/ul&gt;</p>
<p>&lt;p&gt;&lt;?php echo $record['summary']; ?&gt;&lt;/p&gt;<br /><br />&lt;?php if(!empty($record['content'])): ?&gt;<br />&lt;a href="&lt;?php echo $record['_link'] ?&gt;" class="btn btn-reveal btn-default"&gt;<br />&lt;i class="fa fa-plus"&gt;&lt;/i&gt;<br />&lt;span&gt;&lt;?php echo htmlencode($record['link_text']) ?&gt;&lt;/span&gt;<br />&lt;/a&gt;<br />&lt;?php endif ?&gt;<br />&lt;/div&gt;<br />&lt;!-- /POST ITEM --&gt;<br />&lt;br/&gt;<br />&lt;?php endforeach ?&gt;<br />&lt;/div&gt;<br />&lt;/div&gt;<br />&lt;/section&gt;<br />&lt;!-- / --&gt;<br /><br />&lt;div class="container"&gt;<br />&lt;?php // echo $GLOBALS["blog_cat"] ;?&gt;<br />&lt;div id="blog" class="clearfix blog-isotope blog-isotope-3"&gt;<br /><br />&lt;?php foreach ($x_newsRecords as $record): ?&gt;<br />Record Number: &lt;?php echo htmlencode($record['num']) ?&gt;&lt;br/&gt;<br />Title: &lt;?php echo htmlencode($record['title']) ?&gt;&lt;br/&gt;<br />Blog Category (value): &lt;?php echo $record['blog_category'] ?&gt;&lt;br/&gt;<br />Blog Category (label): &lt;?php echo $record['blog_category:label'] ?&gt;&lt;br/&gt;<br />author: &lt;?php echo htmlencode($record['author']) ?&gt;&lt;br/&gt;</p>
<p>&lt;?php foreach ($record['photo'] as $index =&gt; $upload): ?&gt;<br />Upload Url: &lt;?php echo htmlencode($upload['urlPath']) ?&gt;&lt;br/&gt;<br />&lt;hr/&gt;</p>
<p>&lt;?php endforeach ?&gt;</p>
<p>&lt;!-- STEP2a: /Display Uploads --&gt;</p>
<p>&lt;hr/&gt;<br />&lt;?php endforeach ?&gt;<br />&lt;/div&gt;<br />&lt;/section&gt;</p>
<p><br />&lt;!-- FOOTER --&gt;<br />&lt;?php include("core-footer.php"); ?&gt;<br />&lt;!-- /FOOTER --&gt;</p>
<p>&lt;/div&gt;<br />&lt;!-- /wrapper --&gt;</p>
<p><br />&lt;!-- SCROLL TO TOP --&gt;<br />&lt;a href="#" id="toTop"&gt;&lt;/a&gt;</p>
<p><br />&lt;!-- PRELOADER --&gt;<br />&lt;div id="preloader"&gt;<br />&lt;div class="inner"&gt;<br />&lt;span class="loader"&gt;&lt;/span&gt;<br />&lt;/div&gt;<br />&lt;/div&gt;&lt;!-- /PRELOADER --&gt;</p>
<p><br />&lt;!-- core bootstrap script --&gt;<br />&lt;?php include("core-bootstrap-script.php"); ?&gt;<br />&lt;!-- /core bootstrap script --&gt;<br />&lt;!-- PAGELEVEL SCRIPTS --&gt;</p>
<p>&lt;!-- /PAGELEVEL SCRIPTS --&gt;<br />&lt;/body&gt;</p>]]></description>
          <pubDate>Mon, 28 Mar 2022 16:57:45 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245898#post2245898</guid>
        </item>
                <item>
          <title>displayed records not matching total records</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245896#post2245896</link>
          <description><![CDATA[<p>Hey craig_bcd,</p>
<p>Unfortunately, the issue isn't apparent just from your code snippets here - I have a few questions to help narrow it down:</p>
<ul><li>Is what you've pasted below the full code on the page? Since the meta array contains the correct number of records and differs from the length of the records array, I am curious if there's any point after getRecords() where the $x_newsRecords variable could be getting modified.</li>
<li>Can you run the getRecords() query with "debugSql" turned on, and copy/paste the output here? Example:<br /><pre class="language-php"><code>list($x_newsRecords, $x_newsMetaData) = getRecords(array(
'tableName' =&gt; 'x_news',
'loadUploads' =&gt; true,
'allowSearch' =&gt; false,
'where' =&gt; "blog_category = '$blog_where'",
'orderBy' =&gt; "`post_date` DESC",
'debugSql' =&gt; true,
));​</code></pre>
</li>
</ul><p>Thanks!</p>]]></description>
          <pubDate>Mon, 28 Mar 2022 16:39:00 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245896#post2245896</guid>
        </item>
                <item>
          <title>displayed records not matching total records</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2245895#post2245895</link>
          <description><![CDATA[<p>Hi All -</p>
<p>I have  a section that breaks up articles into different catagories then I display those catagories of articles on different pages.  I have done this a lot on websites but it is not working here and for the life of me I cannot see what is going on.</p>
<p>Below I have identified the components This is where it pulls the records for the page - if I do a record count for that subset of records (see below) the total records lists 15 (which is accurate) but when I do a foreach loop to loop through those records 6 records show up and they are all for category 5 (see attachment for results example).  This code is from a test page which I built to see if I could figure out the issue which is why there are some variables in there that are not normally there. </p>
<p>I am out of idea's it makes no sense to me.  Any help is appreciated.</p>
<p>Thanks!</p>
<p><strong>This is where it pulls records from the cms on page: </strong></p>
<p>$blog_where = "2";</p>
<p>$libraryPath = 'cmsb/lib/viewer_functions.php';<br />$dirsToCheck = array('/home/xanitoshqadmin/public_html/','','../','../../','../../../');<br />foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}<br />if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }</p>
<p>list($x_newsRecords, $x_newsMetaData) = getRecords(array(<br />'tableName' =&gt; 'x_news',<br />'loadUploads' =&gt; true,<br />'allowSearch' =&gt; false,<br />'where' =&gt; "blog_category = '$blog_where'",<br />'orderBy' =&gt; "`post_date` DESC",<br />));</p>
<p><strong>This displays the record count just as a check:</strong></p>
<p>$blog_rec = $x_newsMetaData['totalRecords'];<br />echo ' # records '. $blog_rec;?&gt;</p>
<p><strong>This is the foreach loop on the page:</strong></p>
<p>&lt;?php foreach ($x_newsRecords as $record): ?&gt;<br />Record Number: &lt;?php echo htmlencode($record['num']) ?&gt;&lt;br/&gt;<br />Title: &lt;?php echo htmlencode($record['title']) ?&gt;&lt;br/&gt;<br />Blog Category (value): &lt;?php echo $record['blog_category'] ?&gt;&lt;br/&gt;<br />Blog Category (label): &lt;?php echo $record['blog_category:label'] ?&gt;&lt;br/&gt;<br />author: &lt;?php echo htmlencode($record['author']) ?&gt;&lt;br/&gt;</p>
<p>&lt;?php foreach ($record['photo'] as $index =&gt; $upload): ?&gt;<br />Upload Url: &lt;?php echo htmlencode($upload['urlPath']) ?&gt;&lt;br/&gt;<br />&lt;hr/&gt;</p>
<p>&lt;?php endforeach ?&gt;</p>
<p><strong>As an FYI - the list field categories are setup like this in the table:</strong></p>
<p>1|Education<br />2|Operations<br />3|Safety and Health<br />4|Awards and Recognition<br />5|Press Releases</p>]]></description>
          <pubDate>Mon, 28 Mar 2022 14:03:54 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2245895#post2245895</guid>
        </item>
              </channel>
    </rss>
  