title: SQL Filter past dates
body: <p>I asked a similar question earlier but didn't have all the facts. How would I modify this query to filter out all dates prior to the current date?</p>
  
  <pre><code>$result = $wpdb-&gt;get_results("SELECT * FROM wp_location_date WHERE location=$id ORDER BY location_date");
  </code></pre>
  
  <p>Complete(ish) code in the function.php file from WordPress.</p>
  
  <pre><code>add_action('wp_ajax_nopriv_fetch_dates', 'get_location_date');
  add_action('wp_ajax_fetch_dates', 'get_location_date');
  function get_location_date() {
  global  $wpdb;
  ob_clean();
  $id = $_POST['id']; // Get the Request Id;
  
  $result = $wpdb-&gt;get_results("SELECT * FROM wp_location_date WHERE location=$id ORDER BY location_date");
  foreach ( $result as $value ) {
       $option .= '&lt;option value="'.$value-&gt;id.'"&gt;';
       $option .= $value-&gt;date_coment;
       $option .= '&lt;/option&gt;';
      }
   echo '&lt;option value="0" selected="selected"&gt;Select Date&lt;/option&gt;'.$option;
  </code></pre>
  
  <p>Thanks for your help in advance. </p>