Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/03/2007, 09:24
Ruben_adap
 
Fecha de Ingreso: julio-2002
Mensajes: 322
Antigüedad: 21 años, 9 meses
Puntos: 0
Re: hacer consulta por categoria

Ahí va...

Código PHP:
$q mysql_query("select t1.DESC_CATEGORIA, t2.* FROM categoria as t1, seccion as t2 where t1.ID_CATEGORIA = t2.ID_CATEGORIA order by ID_CATEGORIA, ID_SECCION");
$categoria = -1;

while (
$qq mysql_fetch_array($q))
{
    if (
$categoria != $qq['ID_CATEGORIA']) {

          echo(
$qq['DESC_CATEGORIA']);
          
$categoria $qq['ID_CATEGORIA'];

    }

    echo 
$qq['DESC_SECCION'];


__________________
Saludos

Rubén
Teléfonos móviles, curiosidades: http://telefonos-moviles.muchodenada.com/