Talha Sarwar Talha Sarwar - 2 months ago 6x
PHP Question

i amtrying to fetch dates from mysql db to fullcalender.js events

i have a table in my database named as employee_leaves,have fields like starting date and ending date i want to fetch those dates and display them dynamically on full calender so far i have done this
but everytimes the alert is executed alerting the error...

$(document).ready(function() {
var calender= $('#cal').fullCalendar({

events: {
error: function() {
alert('There was an error while fetching events.');


this is my events.php file

$sql_get_leaves="SELECT * from employee_leaves";
echo json_encode($events);


Check the code properly. For ( = ) you have written as ( - ) Change and try:-

$events = array();

And also add the success function in our javascript function.