By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Lock Problem

P: 34
i want to use lock function in my project to lock the database table when i am pressing a button in front_end. at simultaniouly (online) another one press the button the request wait untill that table was unlock.

plz help to me
to solve this problem it was very urgent
Aug 22 '07 #1
Share this Question
Share on Google+
1 Reply

P: 34
this is answer for question

my $sth1=$dbh->prepare("select no from max_no") or warn "Erron in prepare statemt ".$dbh->errstr;

my $sth2=$dbh->prepare("UPDATE max_no SET no = ? where no = ?") or warn "Erron in prepare statemt ".$dbh->errstr;

my $lock = $dbh->do("lock table max_no in share row exclusive mode");

my $err=$sth1->execute();



if($update == 1000 ) {
$update = 1;

my $err;

eval {

else {

if($err != 1) {
$err = 2;

Aug 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.