Ver Mensaje Individual
  #7 (permalink)  
Antiguo 15/11/2007, 10:29
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: reducir codigo

Solo ciclas el resultado:
Código PHP:
$query "SELECT `id_sector`, COUNT(*) AS 'total' FROM `producto` GROUP BY `id_sector`";
$result mysq_query$query );
while( 
$row mysql_fecth_array$result ) {
      
printf"Para el sector %s, hay %s productos"$row['id_sector'], $row['total'] );

Saludos.