Looking at your message I guess I can assume the following:
1) You haven't used PHP much or at all with PostgreSQL.
2) You don't care who can access this page or you are going to use
Apache Authentication
3) The state of the data is universal, in other words if 3 people invoke
your script they will all get different answers.
4) You need to spend a little time on http://www.php.net, looking at the
PostgreSQL functions.
> I am getting ready to write some PHP code that will involve the
> following:
>
> [1] make a connection to a Postgres DB via PHP/Apache
use: pg_connect | pg_pconnect
> [2] query a table for records. only get new records that we didn't get
> last
> query. guess I'll have to set some sort of flag.
I would use a sequence. So, instead of having to update 100 rows you
just keep track of one number and use it in subsequent selects.
> [3] email the results to the requestor
You can do this in PHP, never done it myself but there are IMAP
functions in PHP. OR you could just pipe the info to a mail program
like sendmail.
> My question is without reinventing the wheel, what the shortest code
> that I can
> write.
<?;?>