<?php include('db.php');
//it's connect the database to server
$sql = "select * from event";
$query = mysql_query ($sql);
?>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
defaultDate: '2016-03-01',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
<?php while($rs = mysql_fetch_array ($query)){
?>
{
title: '<?php echo $rs['title']?>',
start: '<?php echo $rs['date']?>'
},
<?php }?>
]
});
});
I want to show title and date as long as there is record in my database table. But this code just doesn't work. Thanks