
ayuda con consulta
Publicado por pachyta (10 intervenciones) el 24/03/2015 23:47:21
HOLA ESTOY REALIZANDO UNA CONSULTA Q AGRUPA DATOS DE UNA CONSULTA, HE LOGRADO QUE LOS AGRUPE PERO SOLO ME SUMA EL CAMPO PUNTOS, Y NO LOS DEMAS CAMPOS QUE SON FJ,FG,PFG,E,V. ACA LES MUESTRO EL CODIGO DE MI CONSUTLA Y OJALA E PUEDAN AYUDA..GRACIAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$query=mysql_query("SELECT *,SUM(puntos) as puntos FROM sumastablas WHERE categoria='A' GROUP BY participante") or die(mysql_error());
// Esta linea hace la consulta
$result = mysql_query($query);
$numero = 1;
while($row2=mysql_fetch_array($query))
{
echo "
<tr>
<td width='150'align='center'>".$numero++."</td>
<td width='150'>".$row2['participante']."</td>
<td width='150' align='center'>".$row2['fj']."</td>
<td width='150' align='center'>".$row2['fg']."</td>
<td width='150' align='center'>".$row2['pfg']."</td>
<td width='150'align='center'>".$row2['v']."</td>
<td width='150'align='center'>".$row2['e']."</td>
<td width='150'align='center'>".$row2['puntos']."</td>
</tr>
";
}
Valora esta pregunta


0