Deleting from database using checkbox values

This seems like such a no-brainer, and I’m sure I’m missing something very simple!

I have a form that has rows queried from a database, and each row has a checkbox with the value equal to the ID number for that row. I want to be able to check each row I want to delete, hit submit, then have them gone. So I’ve done this:

<input type=“checkbox” name=“deleterow” value=“#comment_id#”>

DELETE FROM comments
WHERE comment_id IN ( <cfqueryparam value=“#FORM.comment_id#” list=“yes”>)

But it only deletes the first instance passed. Do I need to make a loop or something? Why won’t they delete all at once? I’ve dumped the form variables and the checkbox value is a comma-delimited list of the expected numbers.

I somehow managed to figure it out, and the problem was too many loops in the form.

I was getting double values on some of the checkboxes, so I had something like 16 17 18, 17 18, 18. Needless to say, only that last one matched anything. I pulled a loop out and she works!