This snippet will take the number of members that your fanlisting has with the number of countries and create a ratio: Members to Countries. Say your fanlisting has 360 members and 36 countries, the ratio would print out to be 10:1. I just remember someone saying that they wanted to make something like this. I am trying to figure out how to make it so that the number of digits after the decimal can be changed and shortened… I will when I feel like it. It only works if you use PHPFanbase.
<b>Member/Country ratio</b>: <? include(“config.php”);
$query1=”SELECT * FROM $table WHERE apr=’y'”;
$result1=mysql_query($query1);
$num1=mysql_numrows($result1);
$query2=”SELECT DISTINCT country FROM $table WHERE apr=’y'”;
$result2=mysql_query($query2);
$num2=mysql_numrows($result2);
if($num2 != 0) {
$ratio = ($num1 / $num2);
print”$ratio:1″;
} else {
print”0:0″;}
?>
Page Views: 8 views



















