= $bis; $y--) { $class = ($y == $von && $mitRand) ? " class='l'" : ""; $html .= "{$y}"; } return $html; } function jahresSpaltenSQL($prefix, $von, $bis, $bedingung = "") { $cols = []; for ($y = $von; $y >= $bis; $y--) { $cond = $bedingung ? " AND {$bedingung}" : ""; $cols[] = "SUM(UJAHR={$y}{$cond}) as {$prefix}_{$y}"; } return implode(",\n ", $cols); } function jahresZellen($row, $prefix, $von, $bis) { $html = ""; for ($y = $von; $y >= $bis; $y--) { $class = ($y == $von) ? " class='l'" : ""; $html .= "" . $row["{$prefix}_{$y}"] . ""; } return $html; } ?>

Fahrradunfälle in Nordrhein-Westfalen in Gemeinden

query($strSQL); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { echo ""; echo ""; echo jahresZellen($row, 'Jahr', $numLatestYear, $numStartYear); echo jahresZellen($row, 'Tode', $numLatestYear, $numStartYear); echo jahresZellen($row, 'Schwerverletzt', $numLatestYear, $numStartYear); echo jahresZellen($row, 'Leichtverletzt', $numLatestYear, $numStartYear); echo ""; echo ""; echo ""; echo "\n"; } ?>
Fahrradunfälle Todesfälle Schwerverletzte Leichtverletzte Fläche Einw. Quote
Name in Tausend
".$row['Gemeinde']."".$row['Flaeche']."".round($row['Einwohner']/1000,1)."".round($row["Quote_{$numLatestYear}"],2)."