pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mauro Bertoli <bertolima@yahoo.it>
To: Yasir Malik <ymalik@cs.stevens.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: PHP postgres connections
Date: Mon, 2 May 2005 11:10:14 +0200 (CEST)
Message-ID: <20050502091014.78133.qmail@web25605.mail.ukl.yahoo.com> (raw)

Hi, Thank for your answers.
I asked here because I had thought the problem was in
how Postgres manage connections.
Sorry
--- Yasir Malik <ymalik@cs.stevens.edu> 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():
> <?php
> $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



view thread (4+ messages)

Message-ID: <20050502091014.78133.qmail@web25605.mail.ukl.yahoo.com>
Permalink:  ../20050502091014.78133.qmail@web25605.mail.ukl.yahoo.com/
Also on:    postgresql.org/message-id/20050502091014.78133.qmail@web25605.mail.ukl.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bertolima@yahoo.it, ymalik@cs.stevens.edu
  Subject: Re: PHP postgres connections
  In-Reply-To: <20050502091014.78133.qmail@web25605.mail.ukl.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox