0
我试图从MySQL数据库中取数据到日历中。 (FullCalendar插件) 我想将提取的数据作为json提要发送以显示在日历上。从数据库中提取事件到FullCalendar
这是显示的事件我的Javascript代码:
events: {
url: 'http://localhost/Hotel/event_source.php',
error: function() {
alert('There was an error while fetching events.');
}
这是event_source.php页面,在这里我从数据库中获取数据:
<?php
include('hoteldb.php');
global $conn;
if($stmt = $conn->prepare("SELECT title, startDate, endDate FROM event"))
{
$stmt->execute();
$stmt->bind_result($title, $startDate, $endDate);
while ($stmt->fetch())
{
$rows[] = array('title' => $title, 'startDate' => $startDate, 'endDate' => $endDate);
}
$stmt->close();
echo json_encode($rows);
}
?>
那么你的要求是什么? – rahul
事件未在日历上显示 – user100000001