There are some errors in your code.
Give this a go....
my $hash = $IN->get_hash;
my @list = exists $hash->{ID} && ref $hash->{ID} eq 'ARRAY' ? @{$hash->{ID}} : $hash->{ID};
for (@list) {
my $query = qq!UPDATE $db_comments SET messageread = '0' WHERE ID = ! . $DBH->quote($_);
return $DBH->do($query) ?
&html_view_messages("User updated.") :
&html_view_messages("Error updating user. Reason: $DBI::errstr");
}
}
Give this a go....
Code:
sub mark_unread { my $hash = $IN->get_hash;
my @list = exists $hash->{ID} && ref $hash->{ID} eq 'ARRAY' ? @{$hash->{ID}} : $hash->{ID};
for (@list) {
my $query = qq!UPDATE $db_comments SET messageread = '0' WHERE ID = ! . $DBH->quote($_);
return $DBH->do($query) ?
&html_view_messages("User updated.") :
&html_view_messages("Error updating user. Reason: $DBI::errstr");
}
}