$sth->execute(); $sth->bind_columns(\my $id, \my $subject, \my $body, \my $mailto, \my $mailfrom, \my $type); while ($sth->fetch) { # loop as before }