Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 8C0169FA372 for ; Mon, 6 Nov 2006 21:24:10 -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 95757-08 for ; Mon, 6 Nov 2006 21:24:08 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.194]) by postgresql.org (Postfix) with ESMTP id 55F379FA0EF for ; Mon, 6 Nov 2006 21:24:08 -0400 (AST) Received: by nz-out-0102.google.com with SMTP id i11so973425nzi for ; Mon, 06 Nov 2006 17:24:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=BRddiJsEz5/pSWOCsZqfTCEY2Dk5cLIkKuYz1dqZ43sJq/VCqDPzPeSVHOHqiM/RLD0VqyqBOzchCF0wyeDyIMHLohGDSdDGkQPeK3DsmqKVy2ZcmpjjWkYo9rEqQcOzixIryeBgUbnGHM4dVDV8hc/Djy05cmuf1thzCOsv0Qg= Received: by 10.65.219.16 with SMTP id w16mr6775434qbq.1162862646531; Mon, 06 Nov 2006 17:24:06 -0800 (PST) Received: from ?10.1.1.14? ( [203.217.18.65]) by mx.google.com with ESMTP id d2sm7828851qbc.2006.11.06.17.24.04; Mon, 06 Nov 2006 17:24:06 -0800 (PST) Message-ID: <454FE031.2080004@gmail.com> Date: Tue, 07 Nov 2006 12:24:01 +1100 From: Chris User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Herbie McDuck CC: Alan Hodgson , pgsql-php@postgresql.org Subject: Re: PostgreSQL locking from PHP scripts References: <20061026181147.50048.qmail@web51309.mail.yahoo.com> <200611061105.29055@hal.medialogik.com> <454FD71E.6070807@faams.net> In-Reply-To: <454FD71E.6070807@faams.net> 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/12 X-Sequence-Number: 3630 Herbie McDuck wrote: > 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? No, it applies to anything you do in a web browser. The HTTP protocol is "stateless" which means all resources, connections etc are killed at the end of the script. Resources of any type are not kept alive at the end of a script. It's not a php thing or , it's a HTTP protocol thing. -- Postgresql & php tutorials http://www.designmagick.com/