如何在fulLcalender上从数据库中获取数据

时间:2016-03-11 12:52:23

标签: javascript php ajax database

我正在研究它,而且我没有从我的事件数据库中获取完整数据,我只从我的表中获得了标题。代码如下。

 events: JSON.parse(json_events),

那是我的代码,只从数据库中提取标题

if($type == 'fetch') {
  $events = array();
  $query = mysqli_query($con, "SELECT * FROM calendar");
  while($fetch = mysqli_fetch_array($query,MYSQLI_ASSOC)) {
    $e = array();
    $e['id'] = $fetch['id'];

    $e['title'] = $fetch['title'];
    $e['start'] = $fetch['startdate'];
    $e['end'] = $fetch['enddate'];
    $e['dob'] = $fetch['dob'];

    $allday = ($fetch['allDay'] == "true") ? true : false;
    $e['allDay'] = $allday;

    array_push($events, $e);
  }
  echo json_encode($events);
}

请帮帮我。

0 个答案:

没有答案
相关问题