Don't really understand the $_SESSION variable : I'm trying to create a login form (new to php and coding) and I made it work but I don't exactly understand what I'm doing in my code and would love to understand it. I included notes about what I understand and what I dont understand in my code.

1.Anyways, my main problem is with the "$_SESSION['umsco'] = $username" why do you need to apply the $username variable to it for it to work? 


2.I don't really understand the $result thing in general.

Thank you to anyone who is willing to help me in advance, it's honestly appreciated. 



```php
// I include the database file so we can get the information from there and apply it in here as well.
include "dbc.php";

// here we select the variables we want from the table 'members'.
$sql = "SELECT id, firstName, lastName FROM members";

// here we do something that I dont really know but this is standard procedure.
$result = mysqli_query($conn, $sql);

// declaring username
$username = $_POST["username"];
$password = $_POST["password"];


// my result thing, again, standard procedure.
$result = $conn->query($sql);

// we insert all values in row, standard procedure.
$row = $result->fetch_assoc();

// here we check if the username is the same as the database.
if ($username == $row["firstName"]) {
    // if it's correct then we start a session
    session_start();
    // we give a session some random letters or numbers and set it to $username, not exactly sure why, but it wont work without it.
    $_SESSION['umsco'] = $username; 
    // we change the location to secrect.php
    header("location: secret.php");
}

// we close the connection, not sure if this is needed, but it seems logical.
$conn->close();

```