I am positive I am missing something here.
I have a MySQL database table setup with: kdate, kday, kmonth, and kontent
kdate is set with an expires date (admin input) formatted as 01-01-2014 date(m-d-Y)
I am trying to get dates older than today to not show on execution of the script.
global $wpdb;
$today = date('m-d-y');
$result = $wpdb->get_results( "SELECT * FROM wp_kaltable WHERE kdate >= $today ORDER BY kdate ASC LIMIT 6 ");
//echo "<pre>"; print_r($result); echo "</pre>";
foreach($result as $row)
{
echo "<div class='kalcontain'><div class='kal'><div class='kdate'><p class='kmonth'>".$row->kmonth."</p><p class='kday'>" .$row->kday."</div><div class='kontent'><p class='ktext'>".$row->kontent. "</p></div><div class'clear'></div></div></div>";
}
When I execute this script, I get all data, even the ones with dates less than today's date. Also, when using ORDER BY, it is ordering by month and day, but not year.
All assistance is appreciated.
(*This code is for testing purposes only)