I have Mysql query to be used in a php script. I just need to know how is it processing and producing output..
$sql = "SELECT events_id, events_name, control_id, (TO_DAYS(events_when) - TO_DAYS(NOW())) dayto "
."FROM events "
."WHERE events_active = 1 AND events_start = 1 AND "
." (TO_DAYS(events_when) - TO_DAYS(NOW())) IN $noticeeventsday ";
Select the event id, event name, control id and the number of days to the event (substract from the event date the acctual date converted to number of days)
From the table events
When the event is active (events_active =1), event start is one (i don’t know the semantics of the fields.. sorry) and the number of days left to the event are included in the list of valid number of days ($noticeeventsday sould be a list like (1,2,3) so if the event is in the next one, two or three days it will be returned by the query.)
HTH!