title: Return row for session PHP
body: <p>I would like to be able to read the account type from a row and return it with the <code>$session</code> name. Let's say I have a table called "accounts", with two columns for the user name and account type. When the user logs in and if it is successful it will start a session. This is the current code:</p>
  
  <pre><code>if( $count == 1 &amp;&amp; $row['userPass']==$password &amp;&amp; $row['type']=="Advanced") {
      $_SESSION['userAdvanced'] = $row['userId'];
      header("Location: index.php");
  </code></pre>
  
  <p>However I would like to make it so I can have something like this:</p>
  
  <pre><code>if( $count == 1 &amp;&amp; $row['userPass']==$password) {
      $_SESSION['user'+[type]] = $row['userId'];
      header("Location: index.php");
  </code></pre>
  
  <p>So that it will return "userAdvanced".</p>
  
  <p>I would also like to be able to have multiple <code>$session</code> types in one if statement. I have tried this but it did not work: (Instead of having two separate if statements merge them into one).</p>
  
  <pre><code>&lt;?php if(isset($_SESSION['userBasic'],['userAdvanced'])){ ?&gt;
    &lt;a class="link" href="/index.php?logout" style="text-decoration:none"&gt;Logout&lt;/a&gt;
  </code></pre>
  
  <p>Apologies if this does not make much sense, Please let me know what to do to improve the question. Thanks.</p>