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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| $req = mysql_query("select * from vocabulairea ;");
echo "<table>";
echo "<tr>";
echo "<td>";
echo "Items";
echo "</td>";
echo "<td>";
echo "Contenu";
echo "</td>";
echo "<td>";
echo "Points";
echo "</td>";
echo "</tr>";
$i = 1;
$pts = 0;
$tab = array();
$nbr = mysql_num_rows($req);
while($i <= $nbr){
$res = mysql_fetch_array($req);
echo "<tr>";
echo "<td>";
echo $res["itemsv"];
echo "</td>";
echo "<td>";
echo $res["contenuv"];
echo "</td>";
echo "<td>";
echo $res["points"];
echo "</td>";
echo "</tr>";
$tab[$i] = $res["points"];
$pts = $pts + $res["points"];
$i++;
}
echo "</table>";
print_r($tab);
for($i=1;$i=30;$i++){
for($j=1;$j=5;$j++){
if($tab[$j] == 0 && $tab[$j+1] == 0){
$pts = 0;
}
}
}
echo "La somme des points est : ".$pts."<br/>"; |
Partager