PHP-Code:
pid = $row['id'];
$rs1 = $db->query("select * from $t_pvote where pid = '$pid'");
$call = $db->num_rows($rs1);
for($i=1;$i<=10;$i++) {
$pi = "p".$i;
if($row[$pi] == "0") { break; }
$rs0 = $db->query("select * from $t_pvote where pid = '$pid' and vote = '$i'");
$c[$i] = $db->num_rows($rs0);
if($c[$i] != 0 && $call != 0){
$p[$i] = 100 / $call * $c[$i];
}
else{
$p[$i]=0;
}
}
$max = max($p);
Kommentar