Re: how to lock a block of php codes



bob.chatman@xxxxxxxxx wrote:
are you talking about 2 users calling a page at the same time?

Exactly.

A little more information:
The php page is actually called by PayPal IPN.
It works just fine in most case.
But a few times PayPal will call this page twice at the same time.
And it causes bugs. Because the first time information hasn't been
insert into the database, the second call happens.
So I want to find a method to avoid this.

Thank you a lot,
Kelvin


kelvin wrote:
Hi,

How to avoid one php page be called by 2 at the same time?
How to lock a block of codes in php?

something like

mutex.Lock
//...............
One service one time
//................
mutex.Unlock

Any way to do this?

Thank you,
Kelvin

.



Relevant Pages

  • Re: how to lock a block of php codes
    ... The php page is actually called by PayPal IPN. ... So I want to find a method to avoid this. ... I generally use a text file as a lock so: ...
    (alt.php)
  • how to lock a block of php codes
    ... How to avoid one php page be called by 2 at the same time? ... How to lock a block of codes in php? ...
    (alt.php)
  • Re: How to develop when so much code already exists?
    ... When I started my adventure in learning php, it was not to design somthing ... Even though some of my codes are verison of other codes used in the past. ... It is these codes that are teaching more about php and how best to use it. ... > there for new programmers to develop their skills without re-inventing the ...
    (alt.php)
  • Re: [PHP] Separating HTML code from PHP code
    ... the html codes from the php codes (i.e. placing them in separate ... finding it difficult doing that at the moment with php. ... html that has an action targetting itself and upon submission the ...
    (php.general)
  • MySQL Time Zones, correct codes, and global variable setting (was: Set time zone)
    ... >> GoLive Gurus, ... This is PHP:P ... GLOBAL variable "TZ" to the Japan time zone. ... what all the accepted codes for different time zones are. ...
    (php.general)