Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The code you are using is designed to work with Pods 1.X, but your query itself looks good. With Pods 2.X you would want to do the code below, which combines the <a href="http://pods.io/docs/code/pods/" rel="nofollow">pods()</a> global function with its method <a href="http://pods.io/docs/code/pods/find/" rel="nofollow">find</a> and then uses the <a href="http://pods.io/docs/code/pods/total/" rel="nofollow">total</a> method to check the number of items returned.</p> <pre><code>$param = array( "where" =&gt; "DATE(enddate) &gt;= CURDATE() AND event_type.name='Training'", "orbery" =&gt; "t.startdate ASC", "limit" =&gt; "100", ); $pod = pods( 'event', $param ); $number = $pod-&gt;total(); </code></pre> <p>You know have the records in $pod and the total number in $number, which you can use to control the loop when you loop through the results in $pod. If you wanted to you could use <a href="http://pods.io/docs/code/pods/total-found/" rel="nofollow">total_found</a> to get the number of records that would have been returned had you not limited it.</p> <p>Also, have you checked that you really have two records that should be returned. It is possible that when you combine the two queries only one of them meets both conditions.</p> <p>You should also check out <a href="http://pointatthemoon.co.uk/2013/10/display-a-forthcoming-event-in-wordpress-with-pods-framework/" rel="nofollow">Perry Bonwell's tutorial</a> where he explains how to query for future events. He uses PHP, not SQL functions to handle the dates, but otherwise he has a similar approach.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload