X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0E56BD1B292 for ; Tue, 11 May 2004 01:30:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 90361-04 for ; Tue, 11 May 2004 01:29:49 -0300 (ADT) Received: from mail.exemail.com.au (mx2.exetel.com.au [220.233.0.3]) by svr1.postgresql.org (Postfix) with SMTP id B2989D1B20D for ; Tue, 11 May 2004 01:29:45 -0300 (ADT) Received: (qmail 13305 invoked by uid 0); 11 May 2004 04:29:43 -0000 Received: from unknown (HELO exemail.com.au) (Paul.Lynch@exemail.com.au@220.233.5.231) by aich.exetel.com.au with SMTP; 11 May 2004 04:29:43 -0000 Message-ID: <40A057F6.4040503@exemail.com.au> Date: Tue, 11 May 2004 14:35:02 +1000 From: Paul Lynch User-Agent: Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yasmine Kedoo , pgsql-php@postgresql.org Subject: Re: Parsing Data, Table to Form References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.8 tagged_above=0.0 required=5.0 tests=HTML_30_40, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200405/14 X-Sequence-Number: 2733 Hi Yasmine, Using your example as much as I can and assuming a single row is being selected for updating. Your patid will be used in place of my keyoftabledata (key of table data) variable. In admininfo.php: \n"; echo "" // add this line echo "" // add this line as well echo ""; } // this will give an update button for each row of data from your result table // I have left out the html table so as to simplify and avoid html issues between tables and forms // The only information being passed to updaat.php is the name patid and its value ?> So updaat.php will have the following: \n"; // name the next php program here echo "Admin ID Number:
\n"; echo "Name:
\n"; echo "Surname:
\n"; echo "Phone:
\n"; echo "Email:
\n"; // and so on for all your data // need an update or accept button before writing back data changes echo "" echo ""; ?> So finally we have the program that puts the data back to the database. I have used writeat.php in this example, but use whatever name fits into your naming convention. The essence of writeat.php: This is only one way of doing the required steps and it leaves all error checking out . One thing I don't like is allowing key fields to be changed so easily by operator input, but you may have valid reasons for this. Generally I hide the key fields from update screens unless required or useful to see. My real programs have a lot of additional stuff but I will try and find the simplest one to send to you off line. Paul Yasmine Kedoo wrote: > Hi Paul. > > I think u do understand what i'm trying to do :-) , but i'm not too > sure i understand what u've told me ;-) > > Do i need to repeat the following line for each bit of data in the table: > > echo ""; > > where 'patid' is the ID field in the database. But I am unsure what to > do with $keyoftabledata. What does this relate to? > > What does $keyforrow relate to here: > > $keyforrow = $_POST["yourkeyid"]; > > Do i need to do this line a number of times for all data in the html > table? > > If u dont mind, it would be nice if u could send me some sample > programs relating to this topic. > > Thanx Again, > > Yasmine >