Code: Select all
$select = "SELECT percentage, (FROM_UNIXTIME(scores.timestamp, '%d-%m-%Y')) as test_date FROM scores, procedures WHERE scores.procedure_id=procedures.procedures_id AND user_id = '#user_filter#' AND category = '#choice#' ORDER BY timestamp ASC;";
$stmt = nuRunQuery($select);
$count = 0;
$data = "window.googleChartsData = [['Test Date', 'Percentage'],";
while($row = db_fetch_object($stmt)) {
$data .= "['" . $row->test_date . "', ". $row->percentage . "],";
$count++;
}
$data .= "];";
if ($count == 0)
$data = "window.googleChartsData = []";
nuAddJavaScript($data);
No errors are reported in the nuBuilder debugger and the browser's JavaScript console