Hey all! Long time since I’ve needed some help, but I’m coding something and cannot remember how to do it right, but know I’m close.
I have a form which has multiple checkboxes. What I want to do, is have a loop take the input from each checkbox and preform a MySQL query with it. For example, say the checkboxes are for emails. You can select multilple emails, choose delete, and have a loop preform the query. Here’s my code, the html part being the part I’m sketchy on.
<input type="checkbox" name="variable[1]">
<input type="checkbox" name="variable[2]">
<input type="checkbox" name="variable[3]">
etc
[code]foreach($variable as $id){
Mysql Query
}[/code]
As far as I remember, that should turn $variable into an array, which I can then use a foreach to preform a query.
Where am I going wrong?