Build an array in your php and format it as json in your javascript. Pass the formatted json to the event property like this :
events: buildRecordsToJson(calendar_records)
function buildRecordsToJson(calendar_records){
var employees = [];
for(var record in calendar_records) {
var item = calendar_records[record];
employees.push({
"title" : "Case # " + item.case_number,
"record" : item.id,
"start" : item.case_due_date
});
}
return employees;
}
Edit :
Assuming this is your result
$result=mysqli_query($con,$sql);
Iterate the result sets from your database and push it to the main array.
$list = array();
while ($row = mysqli_fetch_row($result))
{
$entry = array();
$entry["booking_date"] = $row["booking_date"];
$entry["booking_start_time"] = $row["booking_start_time"];
array_push($list,$entry);
}
mysqli_free_result($result);
Return $list array to your javascript and feed it to your calendar events after you formatted it to json (might not be necessary).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…