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 14418 Feb 25, 2005, 3:31 PM
Thread; hot thread Re: [shann123] Loop help
webmaster33 14214 Feb 26, 2005, 5:21 PM
Thread; hot thread Re: [webmaster33] Loop help
shann123 14202 Feb 26, 2005, 10:25 PM
Thread; hot thread Re: [shann123] Loop help
webmaster33 14206 Feb 27, 2005, 1:22 AM
Thread; hot thread Re: [webmaster33] Loop help
shann123 14235 Feb 27, 2005, 11:07 AM
Thread; hot thread Re: [shann123] Loop help
webmaster33 14229 Feb 27, 2005, 4:40 PM
Thread; hot thread Re: [webmaster33] Loop help
shann123 14216 Feb 28, 2005, 6:27 AM
Thread; hot thread Re: [shann123] Loop help
shann123 14214 Feb 28, 2005, 6:48 AM
Post; hot thread Re: [shann123] Loop help
webmaster33 14194 Feb 28, 2005, 8:55 AM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14205 Feb 28, 2005, 2:14 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14195 Feb 28, 2005, 3:29 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14178 Feb 28, 2005, 4:28 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14221 Feb 28, 2005, 4:34 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14194 Feb 28, 2005, 4:42 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14183 Feb 28, 2005, 4:48 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14164 Feb 28, 2005, 4:54 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14160 Feb 28, 2005, 5:00 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14194 Feb 28, 2005, 5:05 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14135 Feb 28, 2005, 5:13 PM
Thread; hot thread Re: [shann123] Loop help
Paul_Wilson 14165 Feb 28, 2005, 5:15 PM
Thread; hot thread Re: [Paul_Wilson] Loop help
shann123 14185 Feb 28, 2005, 5:18 PM
Post; hot thread Re: [shann123] Loop help
Paul_Wilson 14151 Feb 28, 2005, 5:20 PM
Post; hot thread Re: [Paul_Wilson] Loop help
webmaster33 14153 Feb 28, 2005, 4:51 PM