0
<? //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 ?>
4

1 回答 1

0

现在您的代码将创建多个events部分,而events应该是一个数组,因此将您的循环移动到实际events部分:

events: [
<? while($row = mysql_fetch_array($fetch_results)){?>
            {
                id: '',
                title:  '<?=$row[title];?>',
                start: '<?=$row[start_time];?>',
                    end: '<?=$row[end_time];?>',

            } ,
<? }?>
]
于 2013-10-10T08:49:18.567 回答