Re: Thread safe

From: Date: Tue, 28 May 2002 18:44:58 +0000
Subject: Re: Thread safe
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-99534@lists.php.net to get a copy of this message
On Mon, 27 May 2002, r wrote: > In java servlets I used to use a "synchronised" block of code to make sure > it was thread safe...how do i do this in PHP? > > Heres what should be thread safe > > { > $r=select max(cno)+1 from MyTable; > (then i insert into the table the new cno plus my name) > insert into mytable ($r,'myname'); > } > How to do this and make sure its thread safe? More of a database issue. "select ... for update" is a good starting point as you search the manual of your particular database platform. miguel

« previous php.general (#99534) next »