X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 81B63D8A55 for ; Fri, 23 Sep 2005 03:31:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63891-10 for ; Fri, 23 Sep 2005 06:31:24 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by svr1.postgresql.org (Postfix) with ESMTP id 27746D8A4E for ; Fri, 23 Sep 2005 03:31:23 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 40so454982nzk for ; Thu, 22 Sep 2005 23:31:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=mEb2vWwlewsoPre5kKnDSs/g+P35qmWeGvhCSFL0avRMKJxE5PXI1w87Wcwssn6/ODAYundoFHk+/ykWUXWp4CYG3oAP3Qe9ZN0L4jWEw0qe/GA9SbB/D9bJ+vc6k4XBPdQPiizcftsAzx5Gl7ZEQATqXvqumb/0nP8mQ5jIvY8= Received: by 10.36.91.2 with SMTP id o2mr5597633nzb; Thu, 22 Sep 2005 23:31:24 -0700 (PDT) Received: by 10.36.120.14 with HTTP; Thu, 22 Sep 2005 23:31:24 -0700 (PDT) Message-ID: Date: Fri, 23 Sep 2005 12:01:24 +0530 From: Gnanavel S Reply-To: Gnanavel S To: "A. Banks" Subject: Re: INSERT and UPDATE page examples? Cc: PostgreSQL PHP List In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4763_2708518.1127457084382" References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.277 required=5 tests=[AWL=0.196, HTML_30_40=0.056, HTML_MESSAGE=0.001, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200509/16 X-Sequence-Number: 3256 ------=_Part_4763_2708518.1127457084382 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline views with rules might help you. On 9/23/05, A. Banks wrote: > > 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 > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > -- with regards, S.Gnanavel Satyam Computer Services Ltd. ------=_Part_4763_2708518.1127457084382 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline views with rules might help you.

On= 9/23/05, A. Banks <abanks@insightbb.com> wrote: I need to construct a set of admin pages for a website so internal users ca= n
INSERT and UPDATE data for a group of related tables.  I don= t want to
re-invent the wheel on this and due to nested foreign key cons= traints, it's
not so straightforward.


Here's my example:

Project---------
proj_id   pkey
title     var= char

Employees
-----------
empl_id   pkey
dept_id=    fkey
name        va= rchar

ProjEmployees (many employees on a project)
--------------
proj_id&nb= sp;  pkey/fkey
empl_id   pkey/fkey

Department
-= ----------
dept_id   pkey
name     = ; varchar


Creating a COMPLETE PROJECT involves populating a= ll 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 a= dd
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 ProjEmploy= ees)
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


---------------------------(en= d of broadcast)---------------------------
TIP 2: Don't 'kill -9' the po= stmaster



--
with regard= s,
S.Gnanavel
Satyam Computer Services Ltd. ------=_Part_4763_2708518.1127457084382--