title: MySQL data into FullCalendar
body: <p><strong>EDIT 2</strong>
  I have the array at the correct format but nothing added to calendar:</p>
  
  <p><a href="https://i.stack.imgur.com/ce0Wk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ce0Wk.jpg" alt="enter image description here"></a></p>
  
  <p><strong>EDIT</strong></p>
  
  <p><a href="https://i.stack.imgur.com/li5jg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/li5jg.jpg" alt="enter image description here"></a></p>
  
  <p>I want to get data from mysql and display it on fullcalendar. I have this PHP code:</p>
  
  <pre><code>&lt;?php
  //Set error reporting on
  error_reporting(E_ALL);
  ini_set("display_errors", 1);
  
  //Include connection file
  require_once('global.php');
  
  //Json and PHP header
  header('Content-Type: application/json');
  $eventss = array();
  $user = $_SESSION['username'];
  $id_logged = $_SESSION['login_id'];
  
      $search_date = "SELECT * FROM appointment INNER JOIN patient ON appointment.patient_id = patient.id WHERE appointment.id_logged = :id_logged";
      $search_date_stmt = $conn-&gt;prepare($search_date);
      $search_date_stmt-&gt;bindValue(':id_logged', $id_logged);
      $search_date_stmt-&gt;execute();
      $search_date_stmt_fetch = $search_date_stmt-&gt;fetchAll();
      $search_date_stmt_count = $search_date_stmt-&gt;rowCount();
  
      foreach($search_date_stmt_fetch as $row)
      {
         $events[] = array( 'title' =&gt; $row['patient_name'], 'start' =&gt; date('Y-m-d',$row['date_app']), 'end' =&gt; date('Y-m-d',$row['date_app']), 'allDay' =&gt; false);
         array_push($events, $event);
  
      }
  
      echo json_encode($event);
  ?&gt;
  </code></pre>
  
  <p>The array that should be returned to fullcalendar so it can display it should be like:</p>
  
  <pre><code>'id'=&gt;'value', 'title'=&gt;'my title', 'start'=&gt;...etc
  </code></pre>
  
  <p>But what the array I am seeing in the XHR is like:</p>
  
  <p><a href="https://i.stack.imgur.com/NA9J1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NA9J1.jpg" alt="enter image description here"></a></p>
  
  <p>Here is fullcalendar script (no errors at the console):</p>
  
  <pre><code>    &lt;script&gt;
          (function ($) { 
              $(document).ready(function() {
  
                $('#calendar').fullCalendar({
                    eventSources: [
  
                      // your event source
                      {
                          url: 'fullcalendar/get-events.php',
  
                          error: function() {
                              alert('there was an error while fetching events!');
                          },
                          color: 'yellow',   // a non-ajax option
                          textColor: 'black' // a non-ajax option
                      }
  
                      // any other sources...
  
                  ]
              });
  
            });
          })(jQuery);
      &lt;/script&gt;
  </code></pre>