I edited the script a bit.
Each thread found starts with MM/DD/YYYY -
I want to find only those threads that have today's date and future in the beginning of the title.
I thought I could create a variable
PHP Code:
$today = date("m/d/Y");
and use
PHP Code:
LEFT(title, 10) >= $today
as part of my search criteria.
Obviously it does not work.
http://www.nccbmwcca.org
How can I find only from today and future?
PHP Code:
ob_start();
$output_bits = '';
$today = date("m/d/Y");
$spacer = date("m");
$get_schedule = vB::$db->query_read("
SELECT *
FROM ".TABLE_PREFIX."thread
WHERE prefixid='Chapter_Event' OR prefixid ='other' AND LEFT(title, 10) >= $today
ORDER BY title ASC");
while($schedule = vB::$db->fetch_array($get_schedule))
{
$str = substr($schedule[title], 0, 2); /* get month of event */
/* separates posts by month */
if ( $str == $spacer )
{
$output_bits .='<a target="_blank" href="showthread.php?t='.$schedule[threadid].'">'.$schedule[title].'</a><br />';
}
else
{
$output_bits .='<br /><a target="_blank" href="showthread.php?t='.$schedule[threadid].'">'.$schedule[title].'</a><br />';
}
$spacer = $str;
}
/* done */
$output = $output_bits;
ob_end_clean();