I am having trouble displaying an event on a calendar for its correct date.
This is my code so far:
$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
$queryEvent = "SELECT * FROM myweekevents WHERE date = '$timestamp' ";
$resultEvent = mysql_query($queryEvent);
$rowEvent = mysql_fetch_assoc($resultEvent);
I am not able to display an event's information for its correct date. The format for a date on my database is Y-M-D. Is that why it is not matching with the timestamp?
mktime(0,0,0,$cMonth,1,$cYear);
returns a raw timestamp value by means of a number.
Please format your date like this:
$rawTime = mktime(0,0,0,$cMonth,1,$cYear);
$timestamp = date( "Y-m-d", $rawTime );