title: How to show info from database in fullcalendar
body: <p>Hope someone can help me. Im trying to integrate Fullcalendar (jQuery) to my website. Its version 1.6.4.</p>
  
  <p>I allready have a database with content I would like to add to the calendar. I  my database the raws have the names:
  - dispalydate (a given date for the event given in the format 2014-03-23. It should be displayed that date)
  - Name (title of the event)
  - id (id in the database)</p>
  
  <p>I can see that Fullcalendar use the below code (from the file json-events.php) to show something in the calender:</p>
  
  <pre><code>&lt;?php
  $year = date('Y');
  $month = date('m');
  echo json_encode(array(
      array(
          'id' =&gt; 111,
          'title' =&gt; "Event1",
          'start' =&gt; "$year-$month-10",
          'url' =&gt; "http://yahoo.com/"
      ),
      array(
          'id' =&gt; 222,
          'title' =&gt; "Event2",
          'start' =&gt; "$year-$month-20",
          'end' =&gt; "$year-$month-22",
          'url' =&gt; "http://yahoo.com/"
      )
  ));
  ?&gt;
  </code></pre>
  
  <p>I have replaced the above code with my own code below. I have connection to the database but nothing is showed in the Fullcalendar  </p>
  
  <pre><code>&lt;?php
  // Create connection
  $con=mysqli_connect("localhost","*****","*****","*****");
  
  // Check connection
  if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  session_start();
  
  $result = mysql_query("SELECT id, name, displaydate AS displaydate FROM caledar");
  mysql_close();
  $events = array();
  while ($row=mysql_fetch_array($result)){            
  $id =  $row['id'];
  $title = $row['name'];
  $start = $row['displaydate']; 
  
  $events = array(
  'id' =&gt;  "$id",
  'name' =&gt; "$title",
  'displaydate' =&gt; "$start"
  );
  
  }
  echo json_encode($events);
  ?&gt;
  </code></pre>
  
  <p>Can someone advice or see what om doing wrong?</p>