You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
<?php
|
|
$stmt0 = $pdo->query("SELECT COUNT(*) AS count FROM article ");
|
|
$row0 = $stmt0->fetch();
|
|
$rowcount = $row0[0];
|
|
$stmt1 = $pdo->query("SELECT category,COUNT(*) AS count FROM article GROUP BY category");
|
|
while ( $row1 = $stmt1->fetch(PDO::FETCH_ASSOC) ) {
|
|
$width=5+$row1['count']/$rowcount*10;
|
|
$height=3+$row1['count']/$rowcount*6;
|
|
|
|
echo('<button type="button" style="height:'.$height.'em; width:'.$width.'em;">');
|
|
echo($row1['category']);
|
|
echo('</button>');
|
|
|
|
}
|
|
?>
|