Talha Sarwar Talha Sarwar - 1 year ago 67
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);

Answer Source

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

$events = array();

And also add the success function in our javascript function.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download