Show calendar generated with JS showing DB information

0

I'm generating a calendar and inserting the events with handles information into the database. When the select only has one result it is displayed normally, but when there is more than one the calendar is not displayed. Could the error be in the loop of repetition or is it not possible to bring the results?

Select used

$sql_principal = "SELECT obras.titulo_traduzido, obras.data_lancamento, obras.id FROM obras where obras.id=1161";
$resultado_principal = mysql_query($sql_principal);

Script that generates the Calendar                               

    $(document).ready(function() {

        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            defaultDate: '2015-10-23',
            editable: true,
            eventLimit: true, // allow "more" link when too many events
            events: [<?php
            while($objeto = mysql_fetch_object($resultado_principal)){
                  echo "{";
                     echo "title: '{$objeto->titulo_traduzido}',";
                     echo "start: '{$objeto->data_lancamento}',";
                     echo "url: 'http://localhost/admin/filme.php?ID={$objeto->id}'";
                 echo "},";
            }
            ?>]
        });

    });

</script>
    
asked by anonymous 27.10.2015 / 02:25

0 answers