I am working on a web portal for a school project and I need to create a signature. I have a table called student in my database where I have supervisor_id_dos and supervisor_id_sup2.
Now I want to use session to check who is logged in and direct them to a particular page to sign but the if statement doesn't run, it skips and loads the page under the else statement.
I don't know what am doing right
<?php
include "connect.php";
session_start(); <br/>
$sql = "SELECT * from student WHERE level ='user' and (supervisor_id_dos='$_SESSION[username]'OR supervisor_id_sup2='$_SESSION[username]')";
$result = mysqli_query($con, $sql);
$row = mysql_num_rows($result);
if($row){
if($_SESSION["username"] = $row["supervisor_id_dos"])
{
header("Location: dos_sign.php");
}
else{
header("Location: wrong_sign.php");
}
}
?>