<?php
$staffid = $_GET['staffid'];
$query = "SELECT active FROM staff WHERE staffid = '$staffid'";
$result = mysqli_query($link, $query) or die(mysqli_error($link));
$status = mysqli_fetch_array($result);
//echo $status['active'];
if ($status['active'] = '0') {
"UPDATE staff
SET active ='1'
WHERE staffid = '$staffid' ";
} else {
"UPDATE staff
SET active ='0'
WHERE staffid = '$staffid'";
}
Here is my code, I'm able to echo the "Active Status" 0 Or 1 But I'm unable to update based on the if else statement.