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: {
url:"events.php",
type:"POST",
error: function() {
alert('There was an error while fetching events.');
}
}
})
});
this is my events.php file
$sql_get_leaves="SELECT * from employee_leaves";
$query_leaves=mysql_query($sql_get_leaves);
$events-array();
$res=mysql_fetch_array($query_leaves);
$e=array();
$e['id']="Leave_1";
$e['title']="Leave";
$e['start']=$res['leave_starting_date'];
$e['end']=$res['leave_ending_date'];
$e['allDay']=false;
array_push($events,$e);
echo json_encode($events);