php 5.2.9 and Postgres 8.3.7

php 5.2.9 and Postgres 8.3.7

am 17.06.2009 10:33:59 von Didier Gasser-Morlay

Hello,

I tried all day yesterday to setup a brand new machine with a fresh
Linux install; with apache 2.2.10 (from source) php 5.2.9 (from source)
and PostgresQL 8.3.7 (from the very neat one-click installer provided by
Enterprisedb) ; everything compiles and installs fine but when trying to
run the first query to my database I consistently get a message about
pg_escape_string function missing.

I am connecting through ADODB which filters any query via

"'".pg_escape_string($this->_connectionID,$s)."'";

I had no problem using the same build with php 5.2.8 and Postgres 8.3.4,
so I ended up using the mod_php5.so module for apache build with these
versions, but would like to get to the bottom of it.


Any idea or comment ?

Didier



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php 5.2.9 and Postgres 8.3.7

am 17.06.2009 12:31:57 von Lester Caine

Didier Gasser-Morlay wrote:
> Hello,
>
> I tried all day yesterday to setup a brand new machine with a fresh
> Linux install; with apache 2.2.10 (from source) php 5.2.9 (from source)
> and PostgresQL 8.3.7 (from the very neat one-click installer provided by
> Enterprisedb) ; everything compiles and installs fine but when trying to
> run the first query to my database I consistently get a message about
> pg_escape_string function missing.
>
> I am connecting through ADODB which filters any query via
>
> "'".pg_escape_string($this->_connectionID,$s)."'";
>
> I had no problem using the same build with php 5.2.8 and Postgres 8.3.4,
> so I ended up using the mod_php5.so module for apache build with these
> versions, but would like to get to the bottom of it.

The obvious question would have to be was postgres actually listed in
phpinfo? It would need to have been anabled in your build ...

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php 5.2.9 and Postgres 8.3.7

am 17.06.2009 13:11:03 von danaketh

Do you have postgres module for PHP installed? This will probably be the
cause.

Didier Gasser-Morlay napsal(a):
> Hello,
>
> I tried all day yesterday to setup a brand new machine with a fresh
> Linux install; with apache 2.2.10 (from source) php 5.2.9 (from
> source) and PostgresQL 8.3.7 (from the very neat one-click installer
> provided by Enterprisedb) ; everything compiles and installs fine but
> when trying to run the first query to my database I consistently get
> a message about pg_escape_string function missing.
>
> I am connecting through ADODB which filters any query via
>
> "'".pg_escape_string($this->_connectionID,$s)."'";
>
> I had no problem using the same build with php 5.2.8 and Postgres
> 8.3.4, so I ended up using the mod_php5.so module for apache build
> with these versions, but would like to get to the bottom of it.
>
>
> Any idea or comment ?
>
> Didier
>
>
>

--

S pozdravem

Daniel Tlach
Freelance webdeveloper

Email: mail@danaketh.com
ICQ: 160914875
MSN: danaketh@hotmail.com
Jabber: danaketh@jabbim.cz


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php 5.2.9 and Postgres 8.3.7

am 17.06.2009 15:44:46 von Didier Gasser-Morlay

Lester,

Sorry, I should have said:
Yes: Postgres is up & running happily on the machine
yes : Postgres is listed in phpinfo; with the correct version; php was
connecting fine to the dababase, this message only happens on the 1st
query which is when the function pg_escape_string is called.






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php 5.2.9 and Postgres 8.3.7

am 17.06.2009 15:45:02 von Didier Gasser-Morlay

Lester,

Sorry, I should have said:
Yes: Postgres is up & running happily on the machine
yes : Postgres is listed in phpinfo; with the correct version; php was
connecting fine to the dababase, this message only happens on the 1st
query which is when the function pg_escape_string is called.






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Using a PostgreSQL refcursor.

am 17.06.2009 17:20:52 von Matthew.Hartman

Good morning.

Is there a way to use a returned refcursor from PostgreSQL using PDO? I
have scoured the web and have yet to find a good result. Here's a few
things I've tried.

This example simply does not work.
-----
$database =3D Database::load(); // Returns a singleton object with PDO
connected to the database.
$sql =3D "select my_function();";
$p =3D $database->query($sql);
$p->execute();
$result =3D $p->fetchAll();
$p->closeCursor();
-----

This example is closer but PDO complains that the cursor is already
open.
-----
$database =3D Database::load(); // Returns a singleton object with PDO
connected to the database.
$sql =3D "BEGIN; select my_function('my_refcursor'); FETCH ALL from
'my_refcursor';";
$p =3D $database->query($sql);
$p->execute();
$result =3D $p->fetchAll();
$p->closeCursor();
-----



Matthew Hartman
Programmer/Analyst
Information Management, ICP
Kingston General Hospital
(613) 549-6666 x4294=20
=20
..now.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php