From: A. Banks <abanks@insightbb.com>
To: PostgreSQL PHP List <pgsql-php@postgresql.org>
Subject: INSERT and UPDATE page examples?
Date: Thu, 22 Sep 2005 21:27:53 -0500
Message-ID: <KBEKKNMFLELKGIADDEPEGEMLCAAA.abanks@insightbb.com> (raw)
I need to construct a set of admin pages for a website so internal users can
INSERT and UPDATE data for a group of related tables. I dont want to
re-invent the wheel on this and due to nested foreign key constraints, it's
not so straightforward.
Here's my example:
Project
---------
proj_id pkey
title varchar
Employees
-----------
empl_id pkey
dept_id fkey
name varchar
ProjEmployees (many employees on a project)
--------------
proj_id pkey/fkey
empl_id pkey/fkey
Department
-----------
dept_id pkey
name varchar
Creating a COMPLETE PROJECT involves populating all of these tables but
users dont think ahead and understand the dependencies. A person adding
Employees to a Project will have to search for that Employee and then add
them. Sometimes they will suddenly realize that they need to create (insert)
a new Employee before they can add them to a Project (add to ProjEmployees)
and maybe then have to create (insert) a new Department, and so on...
Are there some pre-existing examples for how to go about this in PHP/Psql?
Thanks,
-Aaron
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-php@postgresql.org
Cc: abanks@insightbb.com
Subject: Re: INSERT and UPDATE page examples?
In-Reply-To: <KBEKKNMFLELKGIADDEPEGEMLCAAA.abanks@insightbb.com>
References: <KBEKKNMFLELKGIADDEPEGEMLCAAA.abanks@insightbb.com>
* 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