Hi! I am using the following code (thanks to whoever wrote it!) in many places on my site:
my $tags = shift;
my $table = $DB->table('HFSHC_members');
my $sth = $table->select (['Username']);
my $output = '<select name=billTO><option value="">--</option>';
while (my $row = $sth->fetchrow_hashref) {
$output .= '<option value='.$row->{Username}.'>'.$row->{Username}.'</option>';
}
$output .= '</select>';
return $output;
}
However, as it is it pulls EVERY Username. What I need is for it to pull just the usernames with Status = Registered. Any ideas? Thanks!
Code:
sub { my $tags = shift;
my $table = $DB->table('HFSHC_members');
my $sth = $table->select (['Username']);
my $output = '<select name=billTO><option value="">--</option>';
while (my $row = $sth->fetchrow_hashref) {
$output .= '<option value='.$row->{Username}.'>'.$row->{Username}.'</option>';
}
$output .= '</select>';
return $output;
}
However, as it is it pulls EVERY Username. What I need is for it to pull just the usernames with Status = Registered. Any ideas? Thanks!