Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB13BkF41466 for ; Thu, 30 Nov 2000 22:11:46 -0500 (EST) (envelope-from pgsql-general-owner@postgresql.org) Received: from jnj.org (cs9344-39.austin.rr.com [24.93.44.39]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eARJtBt71155; Mon, 27 Nov 2000 14:55:11 -0500 (EST) (envelope-from jason@jnj.org) Received: (from jburnett@localhost) by jnj.org (8.9.3/8.9.3) id NAA28009; Mon, 27 Nov 2000 13:54:38 -0600 X-Authentication-Warning: pluto.jnj.org: jburnett set sender to jason@jnj.org using -f Date: Mon, 27 Nov 2000 13:54:38 -0600 From: Jason To: Bernie Huang Cc: PHP_DB , PHP_General , PGSQL-SQL , PGSQL-GENERAL Subject: Re: [PHP] a script that queries database periodically Message-ID: <20001127135438.B27680@jnj.org> References: <3A22B485.E8963417@ec.gc.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3A22B485.E8963417@ec.gc.ca>; from bernie.huang@ec.gc.ca on Mon, Nov 27, 2000 at 11:22:45AM -0800 X-Archive-Number: 200011/1027 X-Sequence-Number: 1173 > I was thinking of writing up a PHP script and put into crontab, which is > somehow easier than a shell script, but PHP is an apache module, so I > cannot execute PHP under crontab (it has to be executed in a browser > right?). I guess a shell script is necessary. So, is it possible to > call 'psql' and returning its query result and I can use sendmail to > email the result? Any other idea? if you know perl, you should check out DBI. Read all about it at www.cpan.org. It's pretty similar to the php database interface.