I want to get some data from database for the welcome page, but i got this error, instead of the name:
Notice: Trying to access array offset on value of type null in C:\xampp\htdocs\session.php on line 10
The code for session.php is:
<?php
include('config.php');
session_start();
$user_check = $_SESSION['login_user'];
$ses_sql = mysqli_query($db,"select nume from users where nume = '$user_check' ");
$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$login_session = $row['nume'];
if(!isset($_SESSION['login_user'])){
header("location:login.php");
die();
}
?>
I searched the solution for this error already on the site, but nothing helped me.