> [snip]
> I'm trying to add some new features to an existing project.  The project
> uses pg_pconnect and sets it into a global var...
>
> What I'm trying to do is to create a new database class which connects
> to a different database on the same server.  By the time my code gets
> reached, the pg_pconnect global var $conn has already been initialized.
>
> ...
>
> Is the persistent connection open only to the database in which it was
> opened for?  How can I choose a different database?
> [/snip]
>
> Yes, a persistent connection will only be used when all the connection
> parameters are the same.  Ergo a new database requires a new connection.
>
> That said, I would also like to point out that there is a bug which can
> be found with php and persistent postgres connections.
>
> http://bugs.php.net/bug.php?id=25404
>
> The solution is to use non-persistent connections.
>
> I'd had a problem over the past few months wherein users of my CMS were
> getting logged out for no reason, and yesterday I was finally able to
> trace it to this.
>
> Switched to non-persistent connections and not one error has occurred
> since, so this might be something to keep in mind.
>
> Cheers and HTH,
>
> Pablo
>

thanks for help...

I mentioned something in my original post, and it seems that it is a
problem...

there's the structure of my page

app-config.inc is prepended via apache
within app-config.inc there is a another file included which does the
initial persistent db calls and such.

I then have the page main.php which has

<?php
global $sys_dbhost,$sys_dbuser,$sys_dbpasswd;
$dbconn = pg_connect("user=$sys_dbuser dbname=bisprojects host=$sys_dbhost
password=$sys_dbpasswd");
echo '->'.$dbconn.'<-';
?>

the scripts just dies whenever I include the pg_connect function... if I
change

echo '->'.$dbconn.'<-';
to
echo '->==='.$dbconn.'====<-';

I'll still see -><- on my page
if I remove the pg_connect function, I'll see
->=======<-;

Basically, no changes to the page take effect when I have the pg_connect
function in place... it just dies or something...

here are the versions  of php, apache, and postgresql I'm running...

Server: Red Hat Linux Advanced Server release 2.1AS
php-pgsql-4.1.2-2.1.6
php-manual-4.1.2-2.1.6
asp2php-gtk-0.75.17-1
php-mysql-4.1.2-2.1.6
php-devel-4.1.2-2.1.6
php-imap-4.1.2-2.1.6
php-odbc-4.1.2-2.1.6
php-ldap-4.1.2-2.1.6
asp2php-0.75.17-1
php-4.1.2-2.1.6
apacheconf-0.8.1-1
apache-manual-1.3.27-6.ent
apache-1.3.27-6.ent
apache-devel-1.3.27-6.ent
postgresql-python-7.1.3-5.rhel2.1AS
postgresql-tcl-7.1.3-5.rhel2.1AS
postgresql-server-7.1.3-5.rhel2.1AS
postgresql-libs-7.1.3-5.rhel2.1AS
postgresql-devel-7.1.3-5.rhel2.1AS
postgresql-contrib-7.1.3-5.rhel2.1AS
postgresql-jdbc-7.1.3-5.rhel2.1AS
postgresql-tk-7.1.3-5.rhel2.1AS
postgresql-7.1.3-5.rhel2.1AS
postgresql-perl-7.1.3-5.rhel2.1AS
postgresql-docs-7.1.3-5.rhel2.1AS
postgresql-odbc-7.1.3-5.rhel2.1AS

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

Reply via email to