Re: [PHP] problem with SUM and Postgres

2002-10-09 Thread Marco Tabini
Sorry, folks... I meant "result" and not "returns" below. End of day = brain fried. :) Marco On Wed, 2002-10-09 at 19:32, Marco Tabini wrote: > Because pg_exec only executes the query and returns the resource that's > associated with the returns. If you want to read the results, you should > us

Re: [PHP] problem with SUM and Postgres

2002-10-09 Thread Marco Tabini
Because pg_exec only executes the query and returns the resource that's associated with the returns. If you want to read the results, you should use pg_fetch_result(): $sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver = '$webserver'"; $hosting_rs = pg_exec($connect, $sql1); $hostin

[PHP] problem with SUM and Postgres

2002-10-09 Thread webmaster
I can't figure out why the following code is not returning a column total: $sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver = '$webserver'"; $hosting = pg_exec($connect, $sql1); echo $hosting; This returns: Resource ID #3 The only thing I can think of is that the hostingcost col