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 C26B1D1E98C for ; Sun, 9 May 2004 12:25:40 -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 40724-03 for ; Sun, 9 May 2004 12:25:19 -0300 (ADT) Received: from tetra.ehpg.net (tetra.ehpg.net [216.218.206.34]) by svr1.postgresql.org (Postfix) with ESMTP id 734B3D1E184 for ; Sun, 9 May 2004 12:25:19 -0300 (ADT) Received: from adsl-68-120-71-245.dsl.irvnca.pacbell.net (ehpg.net) [68.120.71.245]by tetra.ehpg.netwith asmtp(Exim 4.31 #1 (Gentoo Linux 1.4))id 1BMqBM-00051d-F7; Sun, 09 May 2004 08:25:36 -0700 Message-ID: <409E4D41.9090707@ehpg.net> Date: Sun, 09 May 2004 08:24:49 -0700 From: "Gavin M. Roy" User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yasmine Kedoo Cc: 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-Antivirus-Scanned: Clean X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200405/6 X-Sequence-Number: 2725 Look at these functions in the php documentation: pg_Query, pg_NumRows, pg_Fetch_Object, and pg_FreeResult http://www.php.net/manual/en/ref.pgsql.php Small example $conn = pg_Connect("host=localhost dbname=test user=postgres"); $result = pg_Query($conn, "SELECT * FROM mytable ORDER BY id LIMIT 1 OFFSET 0;"); $rows = pg_NumRows($result); if ( $rows == 0 ) echo "Sorry no data found.\n"; else { $data = pg_Fetch_Object($result, 0); pg_FreeResult($result); echo "
\n"; echo "Field 1: field1\">
\n"; echo "Field 2: field2\">
\n"; echo "Field 3: field3\">
\n"; echo "
\n"; } Yasmine Kedoo wrote: > Hi. > > I have done a search on one of my PHP pages, and displayed the results > in a table on another page. > > Then when a button is clicked, i want to be able to display the table > information in editable form fields, so that the data may be altered > and the database updated. > > Does anyone have any ideas how i may be able to carry this out? :-) > It's the parsing the data that i am unable to do. > > Thanx Again > > Yaz > > _________________________________________________________________ > Use MSN Messenger to send music and pics to your friends > http://www.msn.co.uk/messenger > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly