Buona notte a tutti
ho uno strano problema che non riesco a risolvere.
Ho dei valori sul database (INT) che mediante while sommo.
poi devo dividere il numero ottenuto per il numero di occorrenze.
ma non funziona la divisione...
Codice PHP:
while($row = mysql_fetch_array($s))
{
$R+=$row['nome_campo1'];
$P+=$row['nome_campo2'];
$S+=$row['nome_campo3'];
$D+=$row['nome_campo4'];
}
while($row2 = mysql_fetch_array($s2))
{
$G+=$row2['nome_campo5'];
$E+=$row2['nome_campo6'];
$C+=$row2['nome_campo7'];
$U+=$row2['nome_campo8'];
}
$NRow = mysql_num_rows($s);
$NRow2 = mysql_num_rows($s2);
$tot_mwi_temp= $R+$P+$S+$D;
$tot_sito_temp= $G+$E+$C+$U;
$tot_mwi= $tot_mwi_temp / $NRow;
$tot_sito= $tot_sito_temp / $NRow2;
I Valori sono
somma SITO :
$R 53
$E 73
$C 62
$U 80
somma MWI :
$R 73
$P 82
$S 95
$D 102
Numero row per il SITO :11
Numero row per la MWI :11
totale SITO :24
totala MWI :32
Dove sbaglio???