title: How to assign a data to Session from select query
body: <p>This is my code </p>
  
  <pre><code>if (count($errors) == 0) {
          $password = md5($password);
          $query = "SELECT * FROM admin WHERE username='".$_POST['username']."' AND passcode='".$_POST['password']."'";
          $results = mysqli_query($db, $query);
  
          if (mysqli_num_rows($results) &gt;0) {
              $_SESSION['username'] = $username;
              $_SESSION['username2'] = "gfgf";
              $_SESSION['username3'] = $row['column_name'];
              $_SESSION['success'] = "You are now logged in";
              header('location: index.php');
          }else {
              array_push($errors, "Wrong username/password combination");
          }
      } 
  </code></pre>
  
  <p>I want to use <code>$_SESSION['username3']</code> .But it is not work. what is the problem with my code. <code>$_SESSION['username2']</code> is finely work.
  there is a matching data in this Table too.</p>