Ok I am using a script i found on http://davidwalsh.name/php-calendar for creating an managing a calendar. Currently I have reached the point were we are to query the database for events.
/** QUERY THE DATABASE FOR AN ENTRY FOR THIS DAY !! IF MATCHES FOUND, PRINT THEM !! **/
$fulldate = strtotime("$month/$list_day/$year");
mysql_select_db($database_dbconnect, $dbconnect);
$query_cal = "SELECT * FROM calendar WHERE startdate > '$fulldate' AND enddate < '$fulldate' AND status = '1' ORDER BY eventtime DESC";
$caldetails = mysql_query($query_cal, $dbconnect) or die(mysql_error());
$cal = mysql_fetch_assoc($caldetails);
Now I have my events in an array. The next line im presented with is
$calendar.= str_repeat('',1);
Now I'm not understanding how im supposed to get my events into that line?I tried using a do or while loop but everything fails. How do I get my array into the str_repeat?
str_repeat() is there only for stub. You should probably write something like:
while ($cal = mysql_fetch_assoc($caldetails)) {
$calendar .= "<p>" . $cal['eventtime'] . ' — ' . $cal['title'] . "</p>";
}
BTW check your SQL query. It seems for me it will return zero results always and it probably should be something like
$fulldate_tomorrow = $fulldate+86400;
$query_cal = "SELECT * FROM calendar WHERE startdate >= '$fulldate' AND enddate < '$fulldate_tomorrow' AND status = '1' ORDER BY eventtime DESC";