Bonjour à tous

j'ai une table "val_cond"

id | nom | duree
------------------------
01 | toto | 1
02 | dudu | 0.5
03 | toto | 1,5
04 | lolo | 2
03 | dudu | 4

J'aimerai faire un regroupement de noms tout en additionnant

le résultat affiché devrait ressembler à un truc comme cela :

toto 2,5
dudu 4.5
lolo 2

Cependant, je n'arrive pas à afficher le calcul

voici mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="fr">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<!-- Encodage en ISO 8859-1, en HTML 5 -->
<meta charset="iso-8859-1" />
<title>Document sans titre</title>
</head>
 
 
<body><br /><br /><br />
<?php
// information pour la connection à le DB
include('../../config.php');
 
//echo '<font color="white">c\'est ok</font>';
$select = '    SELECT nom, SUM (duree) FROM val_cond';    
 
 
$result = $conn->query($select);
$total = mysqli_num_rows($result);
 
 
if($total) {
 
 
    // debut du tableau
 
 
    echo '<table align="center" bgcolor="">'."\n";
 
 
        echo '<tr>';    
 
 
          echo '</tr>'."\n";
 
 
    while($row = mysqli_fetch_array($result)) {
 
 
        echo '<tr>';
        echo '<td align="left"; title=""; style="font-size:40px; color:#b5fffc" >- '.$row["nom"].'</td>';
        echo '<td align="left"; title=""; style="font-size:40px; color:#b5fffc" >- '.$row["duree"].'</td>';
 
        echo '<td style="text-align:top;"><a href="validation.php?id='.$row["id"].'&amp; date_fr='.$row["date_fr"].'&amp; date_en='.$row["date_en"].'&amp; matricule_creation='.$row["matricule_creation"].'&amp; tache='.$row["tache"].'"><img src="../../images/valid2.png" width="80" height="35"></a></td>';
        echo '</tr>';
 
        echo '<tr>';
        echo '<td align="center"; title=""; style="font-size:40px; color:#ffb5b5" >---------------------------------</td>';
        echo '</tr>';
        }
   echo '</table>'."\n";
 
}
    // fin du tableau.
else echo '<br>Aucune tache enregistrée';
 
 
// on libère le résultat
 
 
mysqli_free_result($result);
?>
 
 
 
 
</body>
</html>
<?php
    }else{echo('<h1>Vous ne disposez pas des droits necessaires pour acceder a cette page</h1>');}
?>
Pourriez-vous m'aider?

Grand merci à vous