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 CAEEAD8937 for ; Thu, 22 Sep 2005 23:27:52 -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 00734-05 for ; Fri, 23 Sep 2005 02:27:47 +0000 (GMT) Received: from sccimhc91.asp.att.net (sccimhc91.asp.att.net [63.240.76.165]) by svr1.postgresql.org (Postfix) with ESMTP id 68291D889A for ; Thu, 22 Sep 2005 23:27:48 -0300 (ADT) Received: from krunk (12-202-107-96.client.insightbb.com[12.202.107.96]) by sccimhc91.asp.att.net (sccimhc91) with SMTP id <20050923022753i9100abjg4e>; Fri, 23 Sep 2005 02:27:53 +0000 From: "A. Banks" To: "PostgreSQL PHP List" Subject: INSERT and UPDATE page examples? Date: Thu, 22 Sep 2005 21:27:53 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/15 X-Sequence-Number: 3255 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