RickySilk has asked for the wisdom of the Perl Monks concerning the following question:
ex: first iteration returns:
1 foo
2 bar
next iteration is appending to first:
1 foo
2 bar
3 musty
4 tshirt
the second iteration should just return:
3 musty
4 tshirt
I've included the while loop below, thanks for any help.
while ( my ($intMemberID,$txtUsername,$txtPassword,$txtName,$txtEmail, +$txtBio) = $rsMembers->fetchrow_array) { my $sth = $dbh->prepare( "SELECT intSiteID,txtURL,txtTitle,txtDesc +ription FROM Sites WHERE intMemberID = ? ORDER BY txtTitle" ); $sth->execute($intMemberID); while ( my ($intSiteID,$txtURL,$txtTitle,$txtDescription) = $sth - +>fetchrow_array) { $websites.= load_template("member_site_index.tmpl", {sid => $i +ntSiteID, url => $txtURL, title => $txtTitle, description => $txtDesc +ription}); } $sth ->finish; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: dbi newbie question
by agoth (Chaplain) on Jul 09, 2001 at 20:51 UTC | |
Re: dbi newbie question
by TheoPetersen (Priest) on Jul 09, 2001 at 20:52 UTC | |
by PrakashK (Pilgrim) on Jul 09, 2001 at 21:07 UTC | |
Re: dbi newbie question
by dsb (Chaplain) on Jul 09, 2001 at 21:23 UTC | |
Re: dbi newbie question
by RickySilk (Initiate) on Jul 10, 2001 at 04:03 UTC |