Hi (and sorry as I am new to using this site), I am getting the error:
Uncaught SyntaxError: Unexpected token '<'
in the php code below:
while ($vrstica = mysqli_fetch_array($rezultat)) {
echo '<link rel="shortcut icon" href="#" />
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
let podatki = [];
podatki = <?php echo json_encode($vrstica); ?>;
google.charts.load("current", {"packages":["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart(cas, hitrost) {
let pomTabela = [["Datum", "Hitrost [m/s]"]];
for(let i=0; i<podatki.length; i+=2){
pomTabela.push([podatki[i],podatki[i+1]]);}
var data = google.visualization.arrayToDataTable(pomTabela);
var options = {
title: "Povprecna hitrost vetra - zadnjih 7 dni",
legend: { position: "bottom" }
};
var chart = new google.visualization.LineChart(document.getElementById("curve_chart"));
chart.draw(data, options);
}
</script>';
}
Now it seems a part of that code, bellow echo does not wish to be displayed here but its only some script brackets. Also the error is connected with the line (which is now also not fully displayed...): podatki = ;
Any help would be appreciated.