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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

PHP Newbie- Display Aggregates in HTML Table



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group