I have a json data from a mysql table that is queried from a php script. The json data is coming correctly like this:
{
"report": [{
"Mes": "Abril",
"Dia": "13",
"Local": "Lisboa",
}]
}
I tried this code to get the data into a html table. But since i'm a noob I don't know why isn't working.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$.getJSON("http://ib.esy.es/_php/select_comissao1.php",
function (data) {
var tr = data.report
for (var i = 0; i < data.length; i++) {
tr = $('<tr/>');
tr.append("<td>" + data[i].Mes + "</td>");
tr.append("<td>" + data[i].Dia + "</td>");
tr.append("<td>" + data[i].Local + "</td>");
$('.table1').append(tr);
}
});
</script>
<table class="table1">
<tr>
<th>Mes</th>
<th>Dia</th>
<th>Hora</th>
</tr>
</table>
Can someone help me?