Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    84
    Thanks
    49
    Thanked 0 Times in 0 Posts

    Query to post only results occurring today or later

    Hello All

    Can anyone shed some light into how I could adjust the PHP below to show only events that are today's date or later?

    Essentially I'm looking to adjust the first script to only show events occurring today or later, currently it shows all events in the table(past,present, & future).


    PHP Code:
    <?php
    require 'connect.inc.php';

    $query "SELECT event, company, location, city, month, day, year FROM calendar_event ORDER by month,day ASC";

    if (
    $query_run mysql_query($query)) {
       while (
    $query_row mysql_fetch_assoc($query_run) ) {
          
    $event$query_row ['event'];
          
    $company$query_row ['company'];
          
    $location$query_row ['location'];
          
    $city$query_row ['city'];
          
    $month$query_row ['month'];
          
    $day$query_row ['day'];              
          
    $year$query_row ['year'];
          
      
          
          echo 
    '<div class="where">'.$event.'</div>'.$company.'<div class="date">'.$month.'/'.$day.'/'.$year.'</div><br>'.$location.', '.$city.'<br><hr style=margin-top:5px;margin-bottom:5px;"/>';
        }

    }
    else{
    echo 
    mysql_error();
    }
    ?>
    Last edited by jchrisphonte; 01-25-2012 at 03:24 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •