Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to display database on Fullcalendar
    primarykey
    data
    text
    <p>I'm currently trying to create a JSON feed for FullCalendar. I currently have a working example, However the output doesn't get my database into the calendar. Anyone have any ideas? I've been stuck on this now..</p> <p>In my codes: </p> <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;link href='css/fullcalendar.css' rel='stylesheet' /&gt; &lt;script src='js/jquery-1.9.1.min.js'&gt;&lt;/script&gt; &lt;script src='js/jquery-ui-1.10.2.custom.min.js'&gt;&lt;/script&gt; &lt;script src='js/fullcalendar.min.js'&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var calendar = $('#calendar').fullCalendar({ editable: true, events : "test1.php", eventClick: function(event) { // opens events in a popup window window.open(event.url, '', 'width=700,height=600'); return false; }, loading: function(bool) { if (bool) { $('#loading').show(); }else{ $('#loading').hide(); } } }); }); &lt;/script&gt; &lt;style&gt; body { margin-top: 40px; text-align: center; font-size: 14px; font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; } #calendar { width: 900px; margin: 0 auto; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id='calendar'&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Code for test1.php</p> <pre><code> $link = mysql_connect('localhost','root','abc123'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('trainingcourse'); $result = mysql_query("SELECT * FROM tbl_course "); Initializes a container array for all of the calendar events $jsonArray = array(); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $eventtest = $row['courseid']; $startdate = $row['startdate']; $starttime = $row['starttime']; $enddate = $row['enddate']; $endtime = $row['endtime']; // Stores each database record to an array $buildjson = array('courseid' =&gt; "$eventtest", 'startdate' =&gt; "$startdate", 'enddate' =&gt; "$enddate", 'allday' =&gt; false); // Adds each array into the container array array_push($jsonArray, $buildjson); } // Output the json formatted data so that the jQuery call can read it echo json_encode($jsonArray); ?&gt; </code></pre> <p>It is unable to display on Calendar.</p> <p>I am really appreciated for your help. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload