I am trying to change the value of an ENUM in a mySQL database that will help identify when a user is logged on or logged off on a website to be displayed to all users of the site. I set an ENUM column with possible values of 0 and 1. 0 being logged off, and 1 being logged on. But it doesnt seem to be changing anything. Here is my code:

```
    //LOGIN
session_start();

$username = ($_POST['username']);
$password = ($_POST['password']);

$sql = "SELECT * FROM users WHERE username = '$username' LIMIT 1";
$query = mysqli_query($conn, $sql);
if ($query) {
    $row = mysqli_fetch_row($query);
    $userid = $row[0];
    $dbusername = $row[1];
    $dbpassword = $row[2];
    $email = $row[4];
    $status = $row[7];
    $permit = $row[6];
    $active = $row[5];
    $fname = $row[8];
    $lname = $row[9];
    $dob = $row[10];
    $signupdate = $row[3];
    $ipadd = $row[11];
    $loggedin = $row[12];
}

if ($username == $dbusername && $password == $dbpassword){
    $_SESSION['username'] = $username;
    $_SESSION['id'] = $userid;
    $_SESSION['email'] = $email;
    $_SESSION['status'] = $status;
    $_SESSION['permit'] = $permit;
    $_SESSION['email_activation'] = $active;
    $_SESSION['first_name'] = $fname;
    $_SESSION['last_name'] = $lname;
    $_SESSION['dob'] = $dob;
    $_SESSION['sign_up_date'] = $signupdate;
    $_SESSION['ipv4'] = $ipadd;
    $_SESSION['loggedin'] = $loggedin;

    $sql = "UPDATE username SET loggedin = '1'";
    header("Location: ../main.php");

```