I have a problem with getting the upcoming event work.
Upcoming event is the first event in database after the day the site is visited.
in mysql database - day, month, year are "d" - int , "m" - int, "y" -int...
a example row
m d y
12 1 2007
I know it is a bad practice... I'm just using it for temporary
I only need to query out one event to database, the script is like:
$query = "SELECT *, STR_TO_DATE(CONCAT(y,'-',m,'-',d), '%Y-%c-%e') AS sort_date FROM events WHERE ADDDATE(NOW(), INTERVAL 300 DAY) = STR_TO_DATE(CONCAT(y,'-',m,'-',d), GET_FORMAT(DATE, 'INTERNAL')) ORDER BY sort_date DESC LIMIT 1";
$result = mysql_query($query, $dbconnect);
while($row = mysql_fetch_array($result))
{ ...
Nothing is shown up... although I have about 10 events in the database.
Any idea?