Files
2026-02-17 09:29:34 -06:00

35 lines
792 B
PHP

<?php
header("Content-type: text/json");
include_once 'config.php';
$db = new DB_Class();
$query = "select * from milling ";
$result = mysql_query( $query );
$rows = array();
$count = 0;
while( $row = mysql_fetch_array( $result ) ) {
$SQL1 = "SELECT knife1spd, knife2spd, knife3spd FROM milling ORDER BY id DESC LIMIT 1";
$serie = new StdClass;
$serie->name = $row['0'];
$result1 = mysql_query($SQL1);
$points = array();
while ($rows = mysql_fetch_array($result1)) {
$points[] = array(strtotime($rows['0']) * 1000, $rows['1']);
}
$serie->data = $points;
$series[] = $serie;
}
// Create a PHP array and echo it as JSON
$ret = $series;
echo json_encode($ret);
?>