Bonjour, j'ai fait un fichier de statitistique qui va chercher le résultat dans une table, jusqu'ici ca va :
global $bargif;
if (($bargif=="" ) or (!isset($bargif))) {
$Lbargif="images/bar1.gif";
$Mbargif="images/bar1.gif";
$Rbargif="images/bar1.gif";
} else {
$Lbargif=$bargif;
$Mbargif=$bargif;
$Rbargif=$bargif;
}
$values = array(); $result = mysql_query("select count(*) from seccont where secid='1'" ); $val = mysql_fetch_row($result); $values[] = $val[0]; $result = mysql_query("select count(*) from seccont where secid='4'" ); $val = mysql_fetch_row($result); $values[] = $val[0]; $result = mysql_query("select count(*) from seccont where secid='5'" ); $val = mysql_fetch_row($result); $values[] = $val[0]; unset($val, $result); $total = 0; foreach($values as $val) $total += $val; $new_values = array(); foreach($values as $count) $new_values[] = substr(100 * $count / $total, 0, 5);
opentable(); echo "<TABLE WIDTH=100% CELLSPACING=2 CELLPADDING=2 BORDER=0 BGCOLOR=\"#FFFFFF\"><TR><TD CLASS=\"HEADER\" COLSPAN=\"2\">\n"; echo ("$total Fiches" )."</TD></TR>"; foreach($new_values as $val) echo "<tr><td><LI><B> Classement :</B></TD><td><img src=\"$Lbargif\" height=14 width=7><img src=\"$Mbargif\" height=14 width=", $val * 2, "><img src=\"$Rbargif\" height=14 width=7> $val % ($total Fiches)</TD></TR>\n";
echo "</TD></TR></TABLE>";
closetable(); |
Le problème est que le nom de chaque "secid" se trouve dans une autre table
$result = mysql_query("select secname(*) from sections" ); |
Les seuls solutions que j'ai trouvé sont de faire des inner join (pas réussies) puis on m'a dis qu'il fallait mieux faire 2 requêtes que de l'utiliser.
En espérant avoir été clair, merci !