Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Loop help

Quote Reply
Loop help
I am currently writing an internal email script into DBManSQL V1 and have run into a problem. I haven't gotten to the point of figuring out loops and how to set them up to work with queries.
Here is what I have so far:

print qq| <b><input type="checkbox" name="ID" value="$row->{ID}">&nbsp;<font color="black"><$sizefont>$row->{date}</font><$sizefont><font color="black"> - <a href="$db_script_link_url&ID=$row->{ID}&show_message=1&ww=on">$row->{received}</a></font><$sizefont><font color="black"> - $row->{subject}</font></b><hr> |;

That is a message link with checkbox. The checkbox is for selecting single or multiple (if I can get it working) messages for marking unread, deleting etc. Here is the sub for marking messages unread:

sub mark_unread {
# --------------------------------------------------------
my $ID_q = $DBH->quote($in{'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);
}
}

So far, that will work if I check 1 message and click the submit button. But I need this to be able to work if more than 1 message is checked. How can I get this to work with more than 1 message being checked?
Thanks for any help!
Shannon
Subject Author Views Date
Thread; hot thread Loop help shann123 10161 Feb 25, 2005, 3:31 PM
Thread; hot thread Re: [shann123] Loop help
webmaster33 9999 Feb 26, 2005, 5:21 PM
Thread; hot thread Re: [webmaster33] Loop help
shann123 9992 Feb 26, 2005, 10:25 PM
Thread; hot thread Re: [shann123] Loop help
webmaster33 9982 Feb 27, 2005, 1:22 AM
Thread; hot thread Re: [webmaster33] Loop help
shann123 10014 Feb 27, 2005, 11:07 AM
Thread; hot thread Re: [shann123] Loop help
webmaster33 10005 Feb 27, 2005, 4:40 PM
Thread; hot thread Re: [webmaster33] Loop help
shann123 10003 Feb 28, 2005, 6:27 AM
Thread; hot thread Re: [shann123] Loop help
shann123 9980 Feb 28, 2005, 6:48 AM
Post; hot thread Re: [shann123] Loop help
webmaster33 9981 Feb 28, 2005, 8:55 AM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 9985 Feb 28, 2005, 2:14 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 9981 Feb 28, 2005, 3:29 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 9960 Feb 28, 2005, 4:28 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 10008 Feb 28, 2005, 4:34 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 9981 Feb 28, 2005, 4:42 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 9971 Feb 28, 2005, 4:48 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 9947 Feb 28, 2005, 4:54 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 9940 Feb 28, 2005, 5:00 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 9980 Feb 28, 2005, 5:05 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 9924 Feb 28, 2005, 5:13 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 9952 Feb 28, 2005, 5:15 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 9957 Feb 28, 2005, 5:18 PM
Post; hot thread Re: [shann123] Loop help
Paul_Wilson 9933 Feb 28, 2005, 5:20 PM
Post; hot thread Re: [Paul_Wilson] Loop help
webmaster33 9944 Feb 28, 2005, 4:51 PM