I'm receiving the error Error In Session when I run my login script:
session_start();
if (isset($_POST['login'])) {
$logusername=$_POST['username'];
$logpassword=sha1(md5($_POST['password']));
$redirectLoginSuccess = "dashboard.php";
$result=mysqli_query($con, "SELECT * FROM users WHERE username='$logusername' AND password='$logpassword'")or die('Error In Session');
$row=mysqli_fetch_array($result);
if($result>0){
$access = mysqli_fetch_assoc($result,0,'access');
$userID = mysqli_fetch_assoc($result,0,'id');
$username = mysqli_fetch_assoc($result,0,'username');
$name = mysqli_fetch_assoc($result,0,'name');
//declare two session variables and assign them
$_SESSION['username'] = $username;
$_SESSION['userID'] = $userID;
$_SESSION['name'] = $name;
$_SESSION['access'] = $access;
}
header("Location: " . $redirectLoginSuccess );
}
I receive this error everytime I run the script not sure exactly where the error is.