X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0B3B79DC93F for ; Sun, 29 Jan 2006 04:39:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13191-06 for ; Sun, 29 Jan 2006 04:39:19 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from 137086.vserver.de (vs137086.vserver.de [62.75.137.86]) by postgresql.org (Postfix) with ESMTP id B40AB9DC97E for ; Sun, 29 Jan 2006 04:39:16 -0400 (AST) Received: from a-kretschmer.de (p54B3AE7A.dip0.t-ipconnect.de [84.179.174.122]) (authenticated bits=0) by 137086.vserver.de (8.12.8/8.12.8) with ESMTP id k0T8dExn001506 for ; Sun, 29 Jan 2006 09:39:15 +0100 Received: from kretschmer by a-kretschmer.de with local (Exim 4.60) (envelope-from ) id 1F385h-0003Y9-Nr for pgsql-general@postgresql.org; Sun, 29 Jan 2006 09:39:21 +0100 Date: Sun, 29 Jan 2006 09:39:21 +0100 From: Andreas Kretschmer To: pgsql-general@postgresql.org Subject: Re: help Message-ID: <20060129083921.GA12003@KanotixBox> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: mutt-ng 1.5.9i (Linux) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.119 required=5 tests=[AWL=0.119] X-Spam-Score: 0.119 X-Spam-Level: X-Archive-Number: 200601/1541 X-Sequence-Number: 90486 Paolo Ditto 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°