Home Forums Chart Support Average of database column Reply To: Average of database column

#27653

Been trying something like this:

foreach ($link->query('Select AVG(PD1), AVG(PD2) from table') as $row) {
        $PD1 = $row['AVG(PD1)'];
        $PD2 = $row['AVG(PD2)'];
        array_push($dataPoints,"$PD1","$PD2");
        array_push($dataPoints2, array("y"=> $dataPoints));
    };

but it doesn’t work