search

Home  >  Q&A  >  body text

Why in this code, the error says that role is an undefined index, but the role has been set to an index type index in my database

//If it is an admin user, update the role in the user information user_info in the current session for page call

if (Session::get('user_info.name') == 'admin') {

          Session::set('user_info.role', $data['role']);

      }


黄子乐黄子乐2578 days ago1295

reply all(4)I'll reply

  • 路过

    路过2017-11-10 16:50:46

    Just print $data to see if there is any

    reply
    0
  • 黄子乐

    $data['id'] exists and can be printed, but $data['role'] cannot. . . what's up

    黄子乐 · 2017-11-10 17:35:54
      丶从不低调

    Have you solved it? Mine is the same.

    丶从不低调 · 2018-02-10 17:31:37
    路过

    You didn't take it out

    路过 · 2017-11-12 18:03:53
  • Cancelreply