If It Possible To Changed Multiple Rows Value Using Checkbox?
If it possible to edit my status field in my database when I check the checkbox? What I want is, when I check multiple rows in my table it updates automatically the value of row['s
Solution 1:
may be you can try this code at php
<?if(isset($_POST['edit']))
{
if(is_array($_POST['checkbox'])){
$status = "yes";
foreach($_POST['checkbox'] as$key=>$value){
$stmt = $mysqli->prepare("UPDATE APP SET status=? WHERE counter= ?");
$stmt->bind_param('ss', $status, $value);
$stmt->execute();
}
}else{
echo"No changes";
}
}
?>
Solution 2:
The name="checkbox[]"
will create an array in $_POST["checkbox"] for you to use. The array will contain the values of all the checkboxes you selected.
Post a Comment for "If It Possible To Changed Multiple Rows Value Using Checkbox?"