X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6FAF3D1B540 for ; Fri, 30 Jul 2004 12:11:48 -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 73587-08 for ; Fri, 30 Jul 2004 15:11:44 +0000 (GMT) Received: from gold.idxwebpro.com (host-64-65-211-224.buf.choiceone.net [64.65.211.224]) by svr1.postgresql.org (Postfix) with SMTP id EEF60D1B537 for ; Fri, 30 Jul 2004 12:11:43 -0300 (ADT) Received: (qmail 79076 invoked by uid 1013); 30 Jul 2004 15:11:16 -0000 Received: from rod@23net.net by gold.idxwebpro.com by uid 1012 with qmail-scanner-1.20st (clamuko: 0.65. spamassassin: 2.63. Clear:RC:0(64.65.211.226):SA:0(0.2/3.8):. Processed in 1.515297 secs); 30 Jul 2004 15:11:16 -0000 Received: from host-64-65-211-226.buf.choiceone.net (HELO ?192.168.1.5?) (rod@gold.idxwebpro.com@64.65.211.226) by gold.idxwebpro.com with SMTP; 30 Jul 2004 15:11:14 -0000 Message-ID: <410A6527.9050705@23net.net> Date: Fri, 30 Jul 2004 11:11:35 -0400 From: Rod K User-Agent: Mozilla Thunderbird 0.4 (Windows/20040707) X-Accept-Language: en MIME-Version: 1.0 To: reiner peterke Cc: pgsql-php@postgresql.org Subject: Re: [0.0] Re: [0.2] getting transactions to work References: <27ABA345-E238-11D8-8EE0-000A95984CA6@drizzle.com> <410A61EB.6070008@23net.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200407/50 X-Sequence-Number: 2875 You can find many resources to explain their purpose better than I can do here. To be honest, I can't see what you are trying to accomplish in your script. If it's validation you should be using session variables to store the input AND echoing what was inputed on the validation page. reiner peterke wrote: > this is meant in all honesty, > > then whats the point?! > > ok, let me put it this way. is there no way to implement pages using > transactions? > otherwise it seems to kind of defeat the purpose of them. > > r > On 30 jul 2004, at 16.57, Rod K wrote: > >> You are correct. You cannot have a transaction span multiple >> pages/scripts. >> >> reiner peterke wrote: >> >>> there seems to be very little info around on actually using >>> transactions with postgres. i've tried to create a page that will >>> take input from a form and insert it into my database. it works if >>> i just do it without transactions but when i try to use with the >>> begin and commit sections of code, it doesn't update the data base. >>> i'm guessing it is doing a rollback when my page loads itself >>> again. can anyone help me out here ? >>> >>> thanks >>> >>> r >>> >>> code below >>> >>> >>> >>> those eyes >>> >>> >>> >> $conn = pg_connect("dbname=entish user=postgres"); >>> if(!$conn) >>> { >>> print "not for the chocolate"; >>> exit; >>> } >>> if ($_POST[submit]) { >>> >>> $begin = pg_query("begin"); >>> $isql = "insert into diety(diety,culture,gender) >>> values >>> ('$_POST[diety]','$_POST[culture]','$_POST[gender]')"; >>> printf("-- %s --\n",$isql); >>> $results = pg_query($isql); >>> ?> >>>
>>> >>> >>>
>>> >> } >>> else if(!$_POST[action]) { >>> ?> >>>
>>> Diety:
>>> Culture:
>>> Gender:
>>> >>>
>>> >> } >>> else { >>> if($_POST[action] == 'commit') { >>> echo "let me see"; >>> $act = pg_query("commit"); >>> } >>> else { >>> $act = pg_query("rollback"); >>> } >>> } //end if $_POST[submit] >>> ?> >>> >>> >>> ---------------------------(end of >>> broadcast)--------------------------- >>> TIP 8: explain analyze is your friend >> >> >> >