From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-general@postgresql.org
Subject: Re: help
Date: Sun, 29 Jan 2006 09:39:21 +0100
Message-ID: <20060129083921.GA12003@KanotixBox> (raw)
In-Reply-To: <ITTA8D$DD1BE8E6F6D3CD2BFC7B3B1F53B1D1F9@libero.it>
References: <ITTA8D$DD1BE8E6F6D3CD2BFC7B3B1F53B1D1F9@libero.it>
Paolo Ditto <paolo_ditto@libero.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°
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: akretschmer@spamfence.net
Subject: Re: help
In-Reply-To: <20060129083921.GA12003@KanotixBox>
References: <ITTA8D$DD1BE8E6F6D3CD2BFC7B3B1F53B1D1F9@libero.it> <20060129083921.GA12003@KanotixBox>
* 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