PHP Newbie- Display Aggregates in HTML Table - Mailing list pgsql-php

From Reed Loefgren
Subject PHP Newbie- Display Aggregates in HTML Table
Date
Msg-id 20060426073420.Q3269@auden.jmla.com
Whole thread Raw
Responses Re: PHP Newbie- Display Aggregates in HTML Table  (Tommy Gildseth <gildseth@start.no>)
List pgsql-php
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

pgsql-php by date:

Previous
From:
Date:
Subject: Re: PostgreSQL 8.1 + PHP5.1.x/4.4.2 + Apache 2.0.55/1.3.34
Next
From: Tommy Gildseth
Date:
Subject: Re: PHP Newbie- Display Aggregates in HTML Table