Folder reorganize 1
This commit is contained in:
35
OLD/charts/canvasjs/data.php
Normal file
35
OLD/charts/canvasjs/data.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$con = mysqli_connect("192.168.0.14","corey","41945549","controls");
|
||||
|
||||
// Check connection
|
||||
if (mysqli_connect_errno($con))
|
||||
{
|
||||
echo "Failed to connect to DataBase: " . mysqli_connect_error();
|
||||
}else
|
||||
{
|
||||
$data_points = array();
|
||||
|
||||
$result1 = mysqli_query($con, "SELECT * FROM trending where trending.id mod 5 = 0 GROUP BY DATE DESC LIMIT 100");
|
||||
$result2 = mysqli_query($con, "SELECT * FROM trending where trending.id mod 5 = 0 GROUP BY DATE DESC LIMIT 100");
|
||||
|
||||
while($row = mysqli_fetch_array($result1))
|
||||
{
|
||||
$point = array("label" => $row['DATE'] , "y1" => $row['BOILER1SF']);
|
||||
|
||||
array_push($data_points, $point);
|
||||
}
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
$point = array("label" => $row['DATE'] , "y2" => $row['BOILER2SF']);
|
||||
|
||||
array_push($data_points, $point);
|
||||
}
|
||||
|
||||
echo json_encode($data_points, JSON_NUMERIC_CHECK);
|
||||
}
|
||||
mysqli_close($con);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user