Hello all,
I am writing a calendar script which returns events, holidays etc.. from MySQL for days with events. This was easy BUT then I tried to return multiple events on some days and thats where I am stuck.
I found some examples of returning arrays from functions from functions but they all use some form of array('1','2','3') and then use a for loop... I am using mysql_fetch_array so this does not seem to work...
First, here is some of the code from the function where I am returning the value:
$sql = "SELECT * FROM cal_events WHERE date_month = '$m' AND date_day = '$d'";
$query= mysql_query($sql);
while ($row = mysql_fetch_assoc($query)) {
$event_title = $row['event_title'];
$description = $row['description'];
$show_event = "<a href='javascript:void(0);' onmousemove=\"showToolTip(event,'".addslashes($description)."');return false\" onmouseout=\"hideToolTip()\">".$event_title."</a>";
return $show_event;
}
And here is where I am calling the functioh
if( ($day + $offset - 1) % 7 == 0 && $day != 1) {
echo "</tr>\n\t<tr>";
$rows++;
}
//Print relevant data into cells
echo"<td><div class='cal_holiday'>". selecteventeng($this->month,$day,$this->gyear) ."</div></td>";
I think I am close but I can't figure out what to do next any ideas?