1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| $sql = select_stau($annee,$id_service);
$result= MYSQL_QUERY($sql);
$s_total = 0;
if(mysql_num_rows($result))
{
while($row=mysql_fetch_row($result)) # boucle pour séparer les resultats
{
$nom_trim = $row[0];
$nom_service= $row[1];
$nom_bacterie = $row[2];
$nom_atb = $row[3];
$R = $row[4];
$I = $row[5];
$S = $row[6];
$total = $R+$I+$S;
echo"$S";
$s_total = $s_total + $s;
if($total != 0)
{
$pourcent = ($S/$total)*100 ;
}
else {
$pourcent = 0;
}
}
}
echo $s_total; |
Partager