我有这个错误,我不知道那是什么错误,我是新手。提前谢谢。
语法错误,意外的'','' (T_CONSTANT_ENCAPSED_STRING),期待','或';'
<?php
$qry = "SELECT tbl_input.* FROM tbl_input";
$result = mysql_query($qry);
?>
$(document).ready(function() {
$('#calendar').fullCalendar({
defaultDate: '2016-01-12',
editable: true,
eventLimit: true, // allow "more" link when too many events
events:
[
<?php
while ($qry = mysql_fetch_array($result))
{
$date = $qry['m_date'];
$name = $qry['comp_name'];
$id = $qry['id'];
$end = new DateTime($schedule);
$Edate = date_format($end, "d");
$Emonth = date_format($end, "n");
$Eyear = date_format($end, "Y");
$emonth = $Emonth - 1;
在这一行的某个地方我有一个错误:
echo'
{
title: "'. $name . '",
start: new Date('.$Eyear.', '.$emonth', '.$Edate.')
},
';
}
?>
]
});
});
</script>
</head>
<div id='calendar'></div>
<?php
include('./inc/footer.inc')
?>
答案 0 :(得分:2)
您错过了.
$emonth
更改
start: new Date('.$Eyear.', '.$emonth', '.$Edate.')
到
start: new Date('.$Eyear.', '.$emonth.', '.$Edate.')