Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id F08139FA16B for ; Mon, 6 Nov 2006 21:04:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 91274-05-2 for ; Mon, 6 Nov 2006 21:04:29 -0400 (AST) X-Greylist: delayed 00:18:54.904174 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 11FB39FB262 for ; Mon, 6 Nov 2006 21:04:25 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from faams.net (mail.faams.net [66.15.246.161]) by svr4.postgresql.org (Postfix) with ESMTP id 65F945AF8C0 for ; Tue, 7 Nov 2006 00:45:31 +0000 (GMT) Received: from [192.168.12.254] (dhcpd254.faams.net [192.168.12.254]) by faams.net (8.12.11/8.12.11) with ESMTP id kA70llmB006285; Mon, 6 Nov 2006 19:47:49 -0500 Message-ID: <454FD71E.6070807@faams.net> Date: Mon, 06 Nov 2006 19:45:18 -0500 From: Herbie McDuck User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Alan Hodgson Cc: pgsql-php@postgresql.org Subject: Re: PostgreSQL locking from PHP scripts References: <20061026181147.50048.qmail@web51309.mail.yahoo.com> <200611061105.29055@hal.medialogik.com> In-Reply-To: <200611061105.29055@hal.medialogik.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/11 X-Sequence-Number: 3629 Alan Hodgson wrote: > On Thursday 26 October 2006 11:11, Amal burman wrote: > >> postgresql database for this project. Here script one >> (booking.php) tries to setup a lock for update and ask >> user to fill-up the form. Now when the user fill-up >> the form and submit it for update, second script >> (update.php) update the database and releasing the >> locks. >> > > You can't do this kind of thing in PHP. PHP resets the database connection > between scripts. The script is finished as soon as the page is delivered > to the client. > > Also, web connections are stateless and there is no way to even know what > web server process or database connection you'll be getting on subsequent > page views. > > So is PHP and 'ANY' database a useless adventure when it goes to developing a robust business and accounting package? --Hal.