Skip site navigation (1) Skip section navigation (2)

Re: help

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: help
Date: 2006-01-29 08:39:21
Message-ID: 20060129083921.GA12003@KanotixBox (view raw or flat)
Thread:
Lists: pgsql-general
Paolo Ditto <paolo_ditto(at)libero(dot)it> schrieb:

> Hi.
> I would want do a php script to access my postgres database from
> remote host. I would like to know how I can do. Particularly, I would

1. you database must listen on TCP/IP and
2. the remote host needs privileges to connect to the DB
   Read
   http://www.postgresql.org/docs/current/static/client-authentication.html
3. with php, you connect to the db:
   $db = pg_connect("host=server dbname=database user=db_user");
   $result = pg_exec($db, $sql);

   There are any other functions like pg_numrows($result),
   pg_fetch_array($result, $i) and so on. Read the PHP-Doku.


> to know the default directory where my database is located so that to
> be able to call it with my php script.

Oh no, wrong. Access to the db with the php-functions, not directly in
the data directorys.


HTH, Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

In response to

  • help at 2006-01-28 16:38:37 from Paolo Ditto

pgsql-general by date

Next:From: Joachim WielandDate: 2006-01-29 17:03:41
Subject: Re: Basic questions about PQprepare()
Previous:From: Karsten HilbertDate: 2006-01-29 08:00:12
Subject: Re: creating users per database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group