Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/09/2010, 16:41
ommm
 
Fecha de Ingreso: septiembre-2010
Mensajes: 92
Antigüedad: 13 años, 7 meses
Puntos: 1
Respuesta: Sumar registros de la misma tabla sql

Por partes... el distinc... no me muestra los resultados en pantalla....
me da este error

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/pruebasa/public_html/jegatura.php on line 14


Código PHP:
$result=mysql_query("SELECT id, jefatura FROM (SELECT DISTINCT jefatura FROM ext)"$link);

echo
"<table width=600>
<tr>
<td><b>Jefatura</b></td><td><b>Extintores</b></td></tr>"
;
while(
$row=mysql_fetch_row($result)){
  echo
"<tr>
    <td>$row[1]</td><td>$row[2]</td>
    </tr>"
;
}
echo
"</table>"
Lo siento, pero es que soy bastante novata en esto. Gracias :D

Última edición por ommm; 27/09/2010 a las 16:48