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 520C3D1E386 for ; Wed, 12 May 2004 19:40:14 -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 98312-04 for ; Wed, 12 May 2004 19:39:56 -0300 (ADT) Received: from mta0.beanfield.net (mta0.beanfield.net [66.207.192.6]) by svr1.postgresql.org (Postfix) with ESMTP id A2BC3D1CA9B for ; Wed, 12 May 2004 19:39:52 -0300 (ADT) Received: from [192.168.205.247] (gw2tor1nat161.beanfield.net [66.207.192.161] (may be forged)) by mta0.beanfield.net (8.12.11/8.12.6) with ESMTP id i4CMdpPM036119 for ; Wed, 12 May 2004 18:39:51 -0400 (EDT) (envelope-from lynna@gallery44.org) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Wed, 12 May 2004 18:45:58 -0400 Subject: Checking data inserted during a transaction From: Lynna Landstreet To: Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/18 X-Sequence-Number: 2737 Hello all, I'm working on an administrative interface in PHP for the art gallery database I created last year, and running into a few issues. Because information has to be entered into several different tables for each exhibition, I've broken down the process of adding new exhibitions to the databases into several pages, each of which processes the form data sent from the previous page and then guides users through the next step (artists featured in the exhibition, etc.). I'm using transactions to handle this, so that at the end of the process the user can (hopefully) review the data they've entered and either commit or rollback the changes. But I'm having a bit of trouble figuring out whether the data I'm trying to insert during the transaction is actually being inserted. From what I've read about transactions thus far, it looks to me as though the data inserted should be visible in the database after the insert is done but before the commit or rollback happens, and then disappear if rollback is chosen. But that doesn't seem to be working. I've loaded the data from the first form into an associative array, added the name of the user who created and last modified the record (at this stage, the same user) and the date created and last modified (again, the same date, since this is the form for adding a new record), and printed the array to make sure all the data is correct. Then I've used the following statement to try and load it into the exhibitions table of the database: $exh_query = pg_insert($db, 'exhibitions', $exh_info) or die ("Unable to insert data."); $db is the database connection, and $exh_info is the array, which I've already tested and made sure is working. Everything appears to go smoothly, it doesn't die, no error message is generated - but the new row does not show up in phpPgAdmin when I check there. Have I done something wrong? Or am I confused and does data entered during a transaction not actually show up until the commit? If that's the case, is there any way I can display all the data for the user to review at the end of the process before committing the changes? I was planning to pull it from the database for that, but if it's not *in* the database, I can't do that. And if I can't, is there perhaps some way to pass an array from one page to the next for several pages, adding to it along the way? I know you can do that with normal variables through either hidden form fields or putting them in the URL, but I don't know about arrays... And at least one of the fields (exhibition_description) is potentially several paragraphs long. Any advice would be appreciated... Thanks, Lynna P.S. My web host is running PHP 4.3.4 and PostgreSQL 7.4 if that's a factor. -- Resource Centre Database Coordinator Gallery 44 www.gallery44.org