zacc has asked for the wisdom of the Perl Monks concerning the following question:
returnsmy $oh_update = $dbh->prepare("update sample_table set active = ? wher +e id < 10"); my $rv1 = $oh_update->execute(1); my $rv11 = $oh_update->rows(); print "1 - Should be none .... $rv1 $rv11\n"; my $rv5 = $oh_update->execute(1); my $rv51 = $oh_update->rows(); print "5 - Should be none .... $rv5 $rv51\n"; my $rv2 = $oh_update->execute(0); my $rv21 = $oh_update->rows(); print "2 - Should be nine .... $rv2 $rv21\n"; my $rv3 = $oh_update->execute(1); my $rv31 = $oh_update->rows(); print "3 - Should be nine .... $rv3 $rv31\n"; my $rv4 = $oh_update->execute(1); my $rv41 = $oh_update->rows(); print "4 - Should be none .... $rv4 $rv41\n";
When I execute the statements in MYSQL query browser, I receive the correct response - 0, then 0, then 9, then 9, then 0 rows updated.1 - Should be none .... 9 9 5 - Should be none .... 9 9 2 - Should be nine .... 9 9 3 - Should be nine .... 9 9 4 - Should be none .... 9 9
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::MYSQL rows updated
by okram (Monk) on Nov 22, 2007 at 21:28 UTC | |
by zacc (Novice) on Nov 22, 2007 at 22:33 UTC |