in reply to Re^7: DBI, prepare_cached, finish, and forks
in thread DBI, prepare_cached, finish, and forks
Thanks for your wisdom!!$dbh->connect(...); # prepare statements $sth->prepare("SELECT ..."); $sth2->prepare("SELECT COUNT(*) FROM table WHERE col=?"); # loop through sth results $sth->execute; while(($var)=$sth->fetchrow_array) { # select the count -- only 1 result row $sth2->execute($var); ($count)=$sth2->fetchrow_array; # finish() here after each fetch? $sth2->finish; } # or should finish() for sth2 be called here # when sth2 won't be used again? #$sth2->finish; $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: DBI, prepare_cached, finish, and forks
by runrig (Abbot) on Feb 24, 2006 at 22:35 UTC |