Skip site navigation (1) Skip section navigation (2)

Re: formatting output: grouping results with identical fields

From: Molly Gibson <molly_gibson2002(at)yahoo(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: formatting output: grouping results with identical fields
Date: 2003-05-12 22:31:34
Message-ID: 20030512223134.16430.qmail@web41810.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-php
--- "scott.marlowe" <scott(dot)marlowe(at)ihs(dot)com> wrote:
>
> What you can do is something like (this is pseudo
> code) before you start 
> your while loop:
> 
> $current_category = <category from first row>
> 
> then in your while loop, check to see if it's
> changed:
> 
> if ($current_category != $new_category){
>     print $new_category;
>     $current_category = $new_category;
> }
> 
> Get the idea? It works a charm for things like this.

Gotcha...nice to know I was on the right track. 
Thanks!

mol

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com


In response to

pgsql-php by date

Next:From: Bruno Pacheco MendonçaDate: 2003-05-13 23:41:23
Subject:
Previous:From: scott.marloweDate: 2003-05-09 22:08:24
Subject: Re: formatting output: grouping results with identical fields

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group