我试图获取从数据库事件到日历,但在这个阶段,它只是输出它的数据库和JSON获得的第一个事件时,我赞同它,它只是返回的第一个事件完整的日历刚刚得到的第一个事件
<?php
include("dbcon.php");
$events1 = array();
$sql345="select * from takimet";
$result = mysql_query($sql345)or die(mysql_error());
while ($row=mysql_fetch_array($result)){
$id = $row['agent_id'];
$title = $row['ezitimi'];
$start = $row['datestamp'];
$events1 = array(
'id' => "$id",
'title' => "$title",
'start' => "$start"
);
}
echo json_encode($events1);
?>
它仍然在日历仅输出所述第一事件在这里是其中i取JSON –
事件:;, 编辑[]:真, droppable:true, –
请不要使用[mysql_'数据库扩展](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php),它 是弃用(一去不复返在PHP7) 特别是如果你刚开始学习PHP,花你的精力学习'PDO'或'mysqli_'数据库扩展, [这里是一些帮助来决定使用哪一种(http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php) – RiggsFolly