You are preparing $sth inside your loop. For the sake of efficiency you could define and prepare $sth before the 1st loop starts. As it is now, you are preparing it everytime you go through the loop when it only needs to be prepared once.
So your code would read:
my $sth = $dbh->prepare( "SELECT ntSiteID,txtURL,txtTitle,txtDescripti +on FROM Sites WHERE intMemberID = ? ORDER BY txtTitle" ); while ( my ($intMemberID,$txtUsername,$txtPassword,$txtName,$txtEmail, +$txtBio) = $rsMembers->fetchrow_array) { $sth->execute($intMemberID); while ( my ($intSiteID,$txtURL,$txtTitle,$txtDescription) = $sth-> +etchrow_array) { $websites.= load_template("member_site_index.tmpl", {sid => $i +ntSiteID, url => $txtURL, title => $txtTitle, description => $txtDesc +ription}); } $sth ->finish; }
Amel - f.k.a. - kel
In reply to Re: dbi newbie question
by dsb
in thread dbi newbie question
by RickySilk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |