FullCalendar, JSON array empty but working on PHP file <p>I am configuring FullCalendar with a MySQL DB, using PHP to process and return a JSON.</p> <ul> <li><strong>db-connect.php</strong> - fetches results from my Db and encodes to JSON.</li> <li><strong>get-events.php</strong> - reads JSON, converts to FullCalendar</li> <li><strong>json.html</strong> - is my front-end calendar view</li> </ul> <p>File contents below, but before reading: <code>db-connect.php</code> successfully outputs JSON that I have verified on JSONLint.</p> <pre><code>[{"title":"Test new calendar","start":"2015-07-21","end":"2015-07-22"}] </code></pre> <p><code>get-events.php</code> is successfully 'reading' <code>db-connect.php</code> as the "php/get-events.php must be running." error message on my front-end view has disappeared (shows if for example it can't establish that <code>db-connect.php</code> is in the directory, or spelling error in file name, etc).</p> <p>However when I either pass the query via <code>params</code> or check in Firebug console, the JSON array is empty.</p> <pre><code>/cal/demos/php/get-events.php?start=2015-07-01&amp;end=2015-07-31 </code></pre> <p>returns <code>[]</code> whereas my test calendar entry does fall within these parameters.</p> <p>I'm convinced it's my <code>db-connect.php</code> that is the error, but I'm scratching my head about it. Relative newbie so I'm sure it's obvious!</p> <p><strong>db-connect.php</strong></p> <pre><code>&lt;?php $db = mysql_connect("localhost:3306","root",""); if (!$db) { die('Could not connect to db: ' . mysql_error()); } mysql_select_db("test",$db); $result = mysql_query("select * from cal", $db); $json_response = array(); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $row_array['id'] = $row['id']; $row_array['title'] = $row['title']; $row_array['start'] = $row['start']; $row_array['end'] = $row['end']; array_push($json_response,$row_array); } echo json_encode($json_response); mysql_close($db); ?&gt; </code></pre> <p><strong>get-events.php</strong></p> <pre><code>&lt;?php // Require our Event class and datetime utilities require dirname(__FILE__) . '/utils.php'; if (!isset($_GET['start']) || !isset($_GET['end'])) { die("Please provide a date range."); } $range_start = parseDateTime($_GET['start']); $range_end = parseDateTime($_GET['end']); $timezone = null; if (isset($_GET['timezone'])) { $timezone = new DateTimeZone($_GET['timezone']); } $json = file_get_contents(dirname(__FILE__) . '/db-connect.php'); $input_arrays = json_decode($json, true); $output_arrays = array(); if (is_array($input_arrays) || is_object($input_arrays)) { foreach ($input_arrays as $array) { $event = new Event($array, $timezone); if ($event-&gt;isWithinDayRange($range_start, $range_end)) { $output_arrays[] = $event-&gt;toArray(); } } } echo json_encode($output_arrays); </code></pre>