Issue 993: Event loading fails while creating a JSON object from MySQL DB.
Status:  Done
Owner: ----
Closed:  Jun 2011
Reported by naik.apo...@gmail.com, Jun 11, 2011
I've modified the json-events.php to connect to a DB on localhost and create an array of fetched results . Later on in the code I've encoded the array into a JSON object, but the calendar doesn't show the events . :(

Here's my code sample.

        mysql_connect("localhost","root","");
	mysql_select_db(db_name); // selects my database 
	
	$res = mysql_query("select * from events");
	$count = mysql_num_rows($res);
	$i=0;
	
	while($i < $count)
	{
		$array = mysql_fetch_array($res);
		
		if(strcasecmp($array['start'],$array['end'])==0)
			$result[$i]=array(
			'id' => intval($array['id']),
			'title' => $array['title'],
			'start' => $array['start']
			);
		else
			$result[$i]=array(
			'id' => intval($array['id']),
			'title' => $array['title'],
			'start' => $array['start'],
			'end' => $array['end']
			);
		$i++;
		
	}

	echo json_encode($result);


Structure of events table:

colname       datatype     format
---------------------------------
id              int         int 
title          text         string
start          text         yyyy-mm-dd
end            text         yyyy-mm-dd
allday         text         always true
Jun 23, 2011
Project Member #1 althaus.it
This is not an issue of FullCalendar. Please ask on Stack Overflow for help: http://stackoverflow.com/questions/tagged/fullcalendar
Status: Done