gpt4 book ai didi

javascript - 如何在jquery High-chart中填充多表数据

转载 作者:行者123 更新时间:2023-11-29 07:19:00 24 4
gpt4 key购买 nike

<分区>

我正在尝试使用以下代码使用 UNION ALL 将多个表数据提取到 high-chart,但我无法做到这一点。

<?php
require_once("db.php");

$db->beginTransaction();

try{

$query = "SELECT SUM(marks) AS marks, DATE(date_column) AS daTe, 'class 1' AS class FROM table1 Group By DATE(date_column)
UNION ALL
SELECT SUM(marks) AS marks, DATE(date_column) AS daTe, 'class 2' AS class FROM table2 Group By DATE(date_column)
UNION ALL
SELECT SUM(marks) AS marks, DATE(date_column) AS daTe, 'class 3' AS class FROM table3 Group By DATE(date_column)";
$done= $db->prepare($query);
$done->execute();
$display = '';
$row = $done->fetch()
$result[] = $row;
//$display .="{name:".$row->class.", data:".$row->marks.", date:".$row->daTe."},";

$db->commit();
}
catch(PDOException $e){
echo 'Connection failed: ' . $e->getMessage();
}

Table 1 (class 1)

Table 2 (class 2)

Table 3 (class 3)

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com