<? //Calendar starts ?>
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
(<? while($row = mysql_fetch_array($fetch_results)){?>),
<? // Events start I need to loop only these events i'm getting from the database table ?>
events: [
{
id: '',
title: '<?=$row[title];?>',
start: '<?=$row[start_time];?>',
end: '<?=$row[end_time];?>',
} ,
]
<? // Events ends?>
(<? }?>)
});
});
<? //Calendar ends ?>
答案 0 :(得分:0)
现在你的代码会创建多个events
部分,而events
应该是一个数组,所以将你的循环移到实际的events
部分:
events: [
<? while($row = mysql_fetch_array($fetch_results)){?>
{
id: '',
title: '<?=$row[title];?>',
start: '<?=$row[start_time];?>',
end: '<?=$row[end_time];?>',
} ,
<? }?>
]