...

View Full Version : Query to post only results occurring today or later



jchrisphonte
01-24-2012, 06:12 PM
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
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();
}
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum