Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [shann123] Loop help

Quote Reply
Re: [shann123] Loop help In reply to
Yes, because you pass the input parameters together instead one by one.
I did not notice that in your previous post.

Try something like this:
Code:
sub mark_unread {
# --------------------------------------------------------
foreach my $id (@{$IN->{'ID'}}) {
my $ID_q = $DBH->quote($id);
$query = qq!
UPDATE $db_comments SET messageread = '0'
WHERE ID = $ID_q
!;
$rc = $DBH->do($query);
$rc ?
($message_q = "User: $in{'username'} updated.") :
($message_q = "Error updating user: $in{'username'}. Reason: $DBI::errstr");
if ($rc) {
&html_view_messages($message);
} else {
&html_view_messages($message);
}
}
}

Also note, I don't know if you should use $in or $IN.
Try other if one doesn't work.
I did not check the rest of code, so still not guaranteed 100%.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Subject Author Views Date
Thread; hot thread Loop help shann123 14553 Feb 25, 2005, 3:31 PM
Thread; hot thread Re: [shann123] Loop help
webmaster33 14347 Feb 26, 2005, 5:21 PM
Thread; hot thread Re: [webmaster33] Loop help
shann123 14336 Feb 26, 2005, 10:25 PM
Thread; hot thread Re: [shann123] Loop help
webmaster33 14339 Feb 27, 2005, 1:22 AM
Thread; hot thread Re: [webmaster33] Loop help
shann123 14368 Feb 27, 2005, 11:07 AM
Thread; hot thread Re: [shann123] Loop help
webmaster33 14363 Feb 27, 2005, 4:40 PM
Thread; hot thread Re: [webmaster33] Loop help
shann123 14349 Feb 28, 2005, 6:27 AM
Thread; hot thread Re: [shann123] Loop help
shann123 14347 Feb 28, 2005, 6:48 AM
Post; hot thread Re: [shann123] Loop help
webmaster33 14327 Feb 28, 2005, 8:55 AM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14338 Feb 28, 2005, 2:14 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14328 Feb 28, 2005, 3:29 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14312 Feb 28, 2005, 4:28 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14354 Feb 28, 2005, 4:34 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14327 Feb 28, 2005, 4:42 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14316 Feb 28, 2005, 4:48 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14297 Feb 28, 2005, 4:54 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14293 Feb 28, 2005, 5:00 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14327 Feb 28, 2005, 5:05 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14268 Feb 28, 2005, 5:13 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14298 Feb 28, 2005, 5:15 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14318 Feb 28, 2005, 5:18 PM
Post; hot thread Re: [shann123] Loop help
Paul_Wilson 14285 Feb 28, 2005, 5:20 PM
Post; hot thread Re: [Paul_Wilson] Loop help
webmaster33 14286 Feb 28, 2005, 4:51 PM