pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Reed Loefgren <rloef@interfold.com>
To: pgsql-php@postgresql.org
Subject: PHP Newbie- Display Aggregates in HTML Table
Date: Wed, 26 Apr 2006 07:50:52 -0600 (MDT)
Message-ID: <20060426073420.Q3269@auden.jmla.com> (raw)

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 ("<tr><td>%s</td><td>%s</td><td>%s</td></tr>",
       $myrow['code'], $myrow['blah'], $myrow['<what goes here?>']);


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



view thread (2+ messages)  latest in thread

Message-ID: <20060426073420.Q3269@auden.jmla.com>
Permalink:  ../20060426073420.Q3269@auden.jmla.com/
Also on:    postgresql.org/message-id/20060426073420.Q3269@auden.jmla.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: rloef@interfold.com
  Subject: Re: PHP Newbie- Display Aggregates in HTML Table
  In-Reply-To: <20060426073420.Q3269@auden.jmla.com>
  References: <20060426073420.Q3269@auden.jmla.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox