If you have multiple
styles and want to know what % of your
users is using what run this:
PHP Code:
<?
include('./global.php');
$usercount = $DB_site->query_first("SELECT count(*) as count from user");
$count = $usercount[count];
$styles=$DB_site->query("select title,user.styleid, count(*) as count from user,style where user.styleid=style.styleid group by user.styleid");
echo "<table cellspacing=0 cellpadding=4 border=1><tr><td>Styled</td><td>Total</td><td>Percent</td></tr>";
while ($style=$DB_site->fetch_array($styles)) {
$percent = round($style[count] / $count * 100,2);
echo "<tr><td>$style[title]</td><td>$style[count]</td><td>".$percent."</td></tr>";
}
echo "</table>";
?>