X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 348ED53316 for ; Mon, 2 May 2005 06:10:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61950-08 for ; Mon, 2 May 2005 09:10:15 +0000 (GMT) Received: from web25605.mail.ukl.yahoo.com (web25605.mail.ukl.yahoo.com [217.12.10.164]) by svr1.postgresql.org (Postfix) with SMTP id B9AE952A71 for ; Mon, 2 May 2005 06:10:13 -0300 (ADT) Received: (qmail 78135 invoked by uid 60001); 2 May 2005 09:10:15 -0000 Message-ID: <20050502091014.78133.qmail@web25605.mail.ukl.yahoo.com> Received: from [84.247.192.193] by web25605.mail.ukl.yahoo.com via HTTP; Mon, 02 May 2005 11:10:14 CEST Date: Mon, 2 May 2005 11:10:14 +0200 (CEST) From: Mauro Bertoli Subject: Re: PHP postgres connections To: Yasir Malik Cc: pgsql-sql@postgresql.org In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.28 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200505/64 X-Sequence-Number: 21377 Hi, Thank for your answers. I asked here because I had thought the problem was in how Postgres manage connections. Sorry --- Yasir Malik ha scritto: > > Hi, > > I need to connect to 2 differents Postgres 8.0.0 > > databases located in the same machine using the > same > > PHP script with an "db wrapper object" instance > > (pg_Connect)... simply a PHP page with > contemporarily > > 2 database connections... > > > I don't think this is the right place to ask this, > but there's an example > on php.net for using the pg_connect(): > $dbconn = pg_connect("dbname=mary"); > //connect to a database named "mary" > > $dbconn2 = pg_connect("host=localhost port=5432 > dbname=mary"); > // connect to a database named "mary" on "localhost" > at port "5432" > > $dbconn3 = pg_connect("host=sheep port=5432 > dbname=mary user=lamb > password=foo"); > //connect to a database named "mary" on the host > "sheep" with a username > and password > > $conn_string = "host=sheep port=5432 dbname=test > user=lamb password=bar"; > $dbconn4 = pg_connect($conn_string); > //connect to a database named "test" on the host > "sheep" with a username > and password > ?> > > I don't know if that answers your question. > > > Can I use however persistent connections ? > > > pg_pconnect() works the same way. > > Regards, > Yasir > ___________________________________ Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica… Scaricalo ora! http://it.messenger.yahoo.it