PHP Newbie- Display Aggregates in HTML Table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux