Ahoj, snazim se pripojit k sobe do MYSQL a vycist hodnoty a ulozit do promennych... Porad mi to nic nevycita a nevim kde delam chybu :
$connect = mysqli_connect("192.168.1.249", "kony", "HesloDB", "Domacnost");
$chart_data = '';
{
$chart_data = "{ timestamp:'".$row["timestamp"]."',teplota:".$row["teplota"].", vlhkost:".$row["vlhkost"].", tlak:".$row["tlak"]."}, ";
}
$chart_data = substr($chart_data, 0, -2);
$query2 = "SELECT * FROM dht_venku ORDER BY ID DESC LIMIT 1";
$result2 = mysqli_query($connect, $query2);
$line = mysqli_fetch_assoc($result2);
echo htmlspecialchars($line['teplota'];
echo htmlspecialchars($line['tlak'];
?>
------------------
tak uprava a taky nic :
<?php
$connect = mysqli_connect("192.168.1.249", "kony", "HesloDB", "Domacnost");
$query = "SELECT * FROM dht_venku ORDER BY ID DESC LIMIT 1";
$result = mysqli_query($connect, $query);
$chart_data = '';
while($row = mysqli_fetch_array($result))
{
$chart_data .= "{ timestamp:'".$row["timestamp"]."',teplota:".$row["teplota"].", vlhkost:".$row["vlhkost"].", tlak:".$row["tlak"]."}";
}
$chart_data = substr($chart_data, 0, -2);
$line = mysqli_fetch_assoc($result);
echo htmlspecialchars($line['teplota'];
echo htmlspecialchars($line['tlak'];
?>