<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Little help from my PHP coding friends please</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Little-help-from-my-PHP-coding-friends-please-80821</link>
        <description></description>
        <pubDate>Thu, 10 Sep 2026 05:52:05 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Little-help-from-my-PHP-coding-friends-please-80821" rel="self" type="application/rss+xml" />

                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240098#post2240098</link>
          <description><![CDATA[<p>Nice tip Jeff!</p>]]></description>
          <pubDate>Tue, 24 Jan 2017 09:39:23 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240098#post2240098</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240094#post2240094</link>
          <description><![CDATA[<p>IF the start or end date is actually today then then the record might not show.</p>
<p><code>'where'       =&gt; "start_date &lt; NOW() AND end_date &gt; NOW() "</code></p>
<p>Instead you want</p>
<p><code>'where'       =&gt; "start_date &lt;<strong>=</strong> NOW() AND end_date &gt;<strong><em>=</em></strong> NOW() "</code></p>
]]></description>
          <pubDate>Tue, 24 Jan 2017 09:26:42 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240094#post2240094</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240079#post2240079</link>
          <description><![CDATA[<p>Thanks for jumping in on this one :)  Looks like that's exactly what Kurt needed.</p>]]></description>
          <pubDate>Thu, 19 Jan 2017 09:33:08 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240079#post2240079</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240075#post2240075</link>
          <description><![CDATA[<p>mazrahi,</p>
<p>Thank You!!  That is exactly what I needed.  The CURDATE() worked perfectly for me.</p>]]></description>
          <pubDate>Thu, 19 Jan 2017 08:00:32 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240075#post2240075</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240070#post2240070</link>
          <description><![CDATA[<p>I think you need something like this.</p>
<p><code>'where'       =&gt; "start_date &lt; NOW() AND end_date &gt; NOW() "</code></p>
<p>Selects any promotion where the start_date is before now AND where end_date is after NOW</p>
<p>You may find that CURDATE() is a better fit than NOW(). NOW() is very specific down to the second. CURDATE() is only concerned with the date itself. </p>]]></description>
          <pubDate>Wed, 18 Jan 2017 18:25:35 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240070#post2240070</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240069#post2240069</link>
          <description><![CDATA[<p>Ross,<br /><br /><br />What I am confused on is how to apply the DB variables to the query and comparing them to 'today's date', is this close to the where statement needed? <br /><br />'where'       =&gt; "date("D, M, Y", strtotime($record['start_date'])) &lt; 'date("D, M, Y"' AND date("D, M, Y", strtotime($record['end_date']) &gt; 'date("D, M, Y"' "</p>]]></description>
          <pubDate>Wed, 18 Jan 2017 11:12:28 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240069#post2240069</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240068#post2240068</link>
          <description><![CDATA[<p>Hi Kurt</p>
<p>Great.</p>
<p>To get a list of records in a specific date range, I would actually use MySQL instead of PHP; it's much more efficient.</p>
<p>Keep in mind that date functions can get rather advanced.</p>
<p>What I would start with is a simple "WHERE"  in your "getRecords" like this:</p>
<p><code>// load records from 'news'<br />  list($newsRecords, $newsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'news',<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    <span style="color:#ff0000;">'where'       =&gt; "<span style="color:#3366ff;">start_time</span> &gt; '2017-01-03' AND <span style="color:#3366ff;">end_time</span> &lt; '2017-01-15' "</span><br />  ));</code></p>
<p>See how I have the "where" setup there?  </p>
<p>Make sure you change the field names so they match your setup. I highlighted my assumed field names in blue.  </p>
<p>Let me know how you make out.</p>
<p>Thanks!</p>]]></description>
          <pubDate>Wed, 18 Jan 2017 10:24:08 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240068#post2240068</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240066#post2240066</link>
          <description><![CDATA[<p>Ross,</p>

<p>More specifically show me all of the records whose start date is &lt;= to today’s date and whose end date is &gt; today.</p>

<p>These are promotions and I need them to display if they are valid today</p>]]></description>
          <pubDate>Wed, 18 Jan 2017 10:07:19 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240066#post2240066</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240064#post2240064</link>
          <description><![CDATA[<p>Hi Kurt</p>
<p>Thanks for posting.</p>
<p>I'd like to clarify what you are looking for.</p>
<p>What I get from you post is that you want to display a list of records whose start and end dates fall within a specific range.</p>
<p>So you need a way to say, show me all records between January 1 and February 23.</p>
<p>Am I on the right track?</p>
<p>Thanks!</p>]]></description>
          <pubDate>Wed, 18 Jan 2017 09:56:01 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240064#post2240064</guid>
        </item>
                <item>
          <title>Little help from my PHP coding friends please</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240060#post2240060</link>
          <description><![CDATA[<p>I have a list viewer and I have start date and end date fields in the list records.  What PHP code will I need to add in the foreach loop to only display items between their start and end dates?</p>
<p>Start Date: &lt;?php echo date("D, M jS, Y g:i:s a", strtotime($record['start_date'])) ?&gt;<br />End Date: &lt;?php echo date("D, M jS, Y g:i:s a", strtotime($record['end_date'])) ?&gt;</p>]]></description>
          <pubDate>Tue, 17 Jan 2017 11:33:58 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240060#post2240060</guid>
        </item>
              </channel>
    </rss>
  