Re: problem with round() in php script - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: problem with round() in php script
Date
Msg-id 4E8D7DD4.3060504@iol.ie
Whole thread Raw
In response to Re: problem with round() in php script  (Robert Buckley <robertdbuckley@yahoo.com>)
List 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@iol.ie

pgsql-general by date:

Previous
From: Vincent de Phily
Date:
Subject: Never-idle autovacuum, and does (auto)vacuuming fill the OS cache ?
Next
From: Adarsh Sharma
Date:
Subject: Re: Postgresql Data directory Issue