$totalplays = $db->num_rows($db->query(sprintf('SELECT sum(views) AS totalpays FROM dd_games WHERE active="1"')));
Total Games Played: <? echo $totalplays; ?>
<?php$query = "SELECT sum(views) FROM dd_games WHERE active='1'"; $result = mysql_query($query) or die(mysql_error());$row = mysql_fetch_array($result);echo $row['SUM(views)'];?>
<?php// Total Games Played$query = "SELECT views, SUM(views) FROM dd_games WHERE active=1"; $result = mysql_query($query) or die(mysql_error());// Get resultwhile($row = mysql_fetch_array($result)){$row['SUM(views)'];$totalgameplays = $row["SUM(views)"];}?>// Print it outHTML:<?php echo $totalgameplays; ?>PHP:'.$totalgameplays.'