Re: Problems in connecting to postgreSQL using PHP

From: Valentín Orfila <valentinorfila(at)gmail(dot)com>
To: "Matthew Terenzio" <matt(at)jobsforge(dot)com>
Cc: "Kitty Yuen" <kitty3a(at)gmail(dot)com>, pgsql-php(at)postgresql(dot)org
Subject: Re: Problems in connecting to postgreSQL using PHP
Date: 2007-03-14 18:06:59
Message-ID: 6b8c0db0703141106u6e136d4mc97df5b4ed0d17fc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Kitty,

Try try using this function: pg_pconnect("host=$servidor dbname=$base
user=$usuario password=$password");, I mean, use the connection script I'm
going to paste below.

<? /*---------------*/
$servidor = "localhost";
$base = "databasename"; //change it
$usuario = "postgresuser"; //change it
$password = "postgresuserpassword"; //change it

pg_pconnect("host=$servidor dbname=$base user=$usuario
password=$password");

?>

2007/3/12, Valentín Orfila <valentinorfila(at)gmail(dot)com>:
>
> here is the script again
>
> <? /*---------------*/
> $servidor = "localhost";
> $base = "databasename"; //change it
> $usuario = "postgresuser"; //change it
> $password = "postgresuserpassword"; //change it
>
> pg_pconnect("host=$servidor dbname=$base user=$usuario
> password=$password");
>
> ?>
>
> 2007/3/12, Valentín Orfila <valentinorfila(at)gmail(dot)com>:
> >
> > Hi!!! I'm Venezuelan and I don't know how to speak english very well, so
> > excuse me if i make a mistake.
> >
> > About the connection: Did you do your script by yourself?, or copied a
> > functional one?
> >
> > As Thomas Schindler said, send us any PHP errors or the pg_hba.conf ?
> >
> > Here is my connection script, it is completly good check it out to see
> > if you have anything wrong
> >
> > <? /*---------------*/
> > $servidor = "localhost";
> > $base = "databasename"; //change it
> > $usuario = "postgresuser"; //change it
> > $password = "postgresuser"; //change it
> >
> > pg_pconnect("host=$servidor dbname=$base user=$usuario
> > password=$password");
> >
> > ?>
> >
> > That's all what I can do for now
> >
> > 2007/3/12, Matthew Terenzio < matt(at)jobsforge(dot)com>:
> > >
> > > Could you provide any PHP errors or the pg_hba.conf ?
> > >
> > > On Mar 12, 2007, at 12:25 AM, Kitty Yuen wrote:
> > >
> > > > Hi,
> > > >
> > > > I am trying to connect my postgreSQL with PHP in localhost. I have
> > > > start up the server with -i flag ( i.e. postmaster -D
> > > > /usr/local/pgsql/data -i &) and edit the pg_hba.conf. However, I
> > > still
> > > > cannot connect with the database. But, when I tried to remote access
> > > > the database through SSH and I can connect with it.
> > > >
> > > > Would you please offer any suggestions or solutions?
> > > >
> > > > Manythanks,
> > > > Kitty3A
> > >
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 2: Don't 'kill -9' the postmaster
> > >
> >
> >
> >
> > --
> >
> > ***************************************************************************
> > Ministerio de Planificación y Desarrollo de la República Bolivariana de
> > Venezuela
> > Dirección de Planes de Personal
> >
> > José Valentín Orfila Briceño
> > Programador II
> >
> > Teléfonos: Celular: (0416) 4131418
> >
> > E-mail: valentinorfila(at)gmail(dot)com
> > valentinorfila(at)hotmail(dot)com
> > josevalentinorfila(at)yahoo(dot)com
> >
> > Messenger: valentinorfila(at)hotmail(dot)com
> >
> > Skype: valentinorfila
> > valentinorfila(at)gmail(dot)com
> > ***************************************************************************
> >
>
>
>
>
> --
>
> ***************************************************************************
> Ministerio de Planificación y Desarrollo de la República Bolivariana de
> Venezuela
> Dirección de Planes de Personal
>
> José Valentín Orfila Briceño
> Programador II
>
> Teléfonos: Celular: (0416) 4131418
>
> E-mail: valentinorfila(at)gmail(dot)com
> valentinorfila(at)hotmail(dot)com
> josevalentinorfila(at)yahoo(dot)com
>
> Messenger: valentinorfila(at)hotmail(dot)com
>
> Skype: valentinorfila
> valentinorfila(at)gmail(dot)com
> ***************************************************************************
>
>

--
***************************************************************************
Ministerio de Planificación y Desarrollo de la República Bolivariana de
Venezuela
Dirección de Planes de Personal

José Valentín Orfila Briceño
Programador II

Teléfonos: Celular: (0416) 4131418

E-mail: valentinorfila(at)gmail(dot)com
valentinorfila(at)hotmail(dot)com
josevalentinorfila(at)yahoo(dot)com

Messenger: valentinorfila(at)hotmail(dot)com

Skype: valentinorfila
valentinorfila(at)gmail(dot)com
***************************************************************************

In response to

Browse pgsql-php by date

  From Date Subject
Next Message enzo venegas palacios 2007-03-16 14:15:44 listen_addresses
Previous Message Valentín Orfila 2007-03-14 17:59:12 Re: Problems in connecting to postgreSQL using PHP