I'm having a couple problems and I think they are all somewhat interconnected.
brief summary of what i'm attempting to do. I'm taking a sql query and i'm looping through the results to build a users table. Then what i'm trying accomplish is for an admin to be able to activate and suspend users by a simple button click. With that being said, let me show the issues i'm having.
1) I'm having issues defining the input type so that each rows checkbox value attibute is the same as that users db id. Then table is constructed inside a while loop using syntax similar to $var .= whatever; var .= whatever2; etc which is how the check box is placed at the beginning of each row.
<input type=\"checkbox\" name=\"checkbox[]\" id='' value=\"{$row['memberid']>\" />
2) I'm having issues capturing the values of which check boxes are checked. This code appears after the end table tag but before the end form tag
$checkBox = $_POST['checkbox'];
for($i=0; $i<sizeof($checkBox); $i++){
$sus_id = $checkbox[$i];
$sql = "UPDATE sometable SET somecolumn='1' WHERE id='$sus_id'";
$result = mysql_query($sql);
mysql_query($query) or die(mysql_error());
}
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=somepage.php\">";
}
Any help would be most appreciated!
var_dump($_POST['checkbox']);result?