且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP 会话变量未定义

更新时间:2022-03-15 03:29:22

这里有两种可能性:

  1. 在页面开头使用 session_start(); 启动会话.
  2. 使用以下代码:

  1. Start the session by using session_start(); at the begining of page.
  2. use the following code:

$accessquery = mysqli_query($conn, "SELECT roleid FROM person WHERE email = '". $email ."'", mysqli_store_result($conn));

$access = mysqli_fetch_row($accessquery);

$_SESSION['Access'] = $access[0];