X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id EC11A11F60AE for ; Wed, 26 Apr 2006 10:56:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 18155-08-3 for ; Wed, 26 Apr 2006 10:55:54 -0300 (ADT) X-Greylist: delayed 00:06:35.762396 by SQLgrey- Received: from b.mail.mho.net (b.mail.base.mho.net [64.58.4.37]) by postgresql.org (Postfix) with SMTP id 99C8011F6701 for ; Wed, 26 Apr 2006 10:55:52 -0300 (ADT) Received: (qmail 89527 invoked from network); 26 Apr 2006 13:49:11 -0000 Received: from dialup-208-157-46-138.mho.net (208.157.46.138) by b.mail.mho.net with SMTP; 26 Apr 2006 13:49:11 -0000 Date: Wed, 26 Apr 2006 07:50:52 -0600 (MDT) From: Reed Loefgren X-X-Sender: rloef@auden.jmla.com To: pgsql-php@postgresql.org Subject: PHP Newbie- Display Aggregates in HTML Table Message-ID: <20060426073420.Q3269@auden.jmla.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.217 tagged_above=0 required=5 tests=BAYES_00, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: * X-Archive-Number: 200604/28 X-Sequence-Number: 3498 All, I have a query that returns data that includes a sum(). I can't get this sum to display in an html table. Like so (in part): Example bit: psql test: select code, blah, sum(time) from test; Portion of PHP table code: while($myrow = pg_fetch_assoc($result)) { printf ("%s%s%s", $myrow['code'], $myrow['blah'], $myrow['']); I'm sure there's errors here, and bad coding too, but it works just fine if I don't have sum() or count(*) in the query. And the query works fine with sums and counts as long as I don't try and execute it in PHP. So my coding is wrong/uneducated. What's amiss here? Thanks, r