Re: problem with round() in php script

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Robert Buckley <robertdbuckley(at)yahoo(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: problem with round() in php script
Date: 2011-10-06 10:07:16
Message-ID: 4E8D7DD4.3060504@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/10/2011 10:02, Robert Buckley wrote:
> Im not quite sure what you are referring to....this is my php code. The
> connection is included, but not in the sql query!
>
> <?
>
> $connection=pg_connect("host=*** port=*** dbname=zgb user=***
> password=***");
>
> $result = pg_query('
> SELECT name,round(ges_kw,0)
> FROM energie.tennet_auswertung_2010
> ');

What I was suggesting was that you try it this way:

$connection = pg_connect(....
$result = pg_query($connection, 'select.....

IOW, you pass $connection as the first argument to pg_query(). See the
PHP docs here:

http://ie.php.net/manual/en/function.pg-query.php

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adarsh Sharma 2011-10-06 10:18:29 Re: Postgresql Data directory Issue
Previous Message Alban Hertroys 2011-10-06 10:01:12 Re: Postgresql Data directory Issue