hakkr has asked for the wisdom of the Perl Monks concerning the following question:
my $result=Select($id,\$dbh); $dbh->disconnect;
None of my other scripts create these sleeping threads so I reckon it's cos I'm passing the db handle.sub SelectProfile { my $id=$_[0]; my $dbh=$_[1]; my $selectquery = "SELECT * FROM people WHERE id = '$id'"; my $sth= $$dbh->prepare($selectquery); $sth->execute(); my $rowdata=$sth->fetchrow_hashref; $$dbh->disconnect; return $rowdata; }##END Select ############################################################
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(ichimunki) Re: Passing database handles
by ichimunki (Priest) on Dec 05, 2001 at 22:39 UTC | |
|
(Ovid - potential security concern) Re: Passing database handles
by Ovid (Cardinal) on Dec 05, 2001 at 23:54 UTC | |
by hakkr (Chaplain) on Dec 06, 2001 at 15:30 UTC | |
|
Re: Passing database handles
by MZSanford (Curate) on Dec 05, 2001 at 23:27 UTC | |
|
Re: Passing database handles
by strat (Canon) on Dec 06, 2001 at 16:49 UTC | |
|
Re: Passing database handles
by perrin (Chancellor) on Dec 05, 2001 at 22:58 UTC | |
by hakkr (Chaplain) on Dec 06, 2001 at 14:22 UTC | |
by perrin (Chancellor) on Dec 06, 2001 at 20:05 UTC |