title: PDO fetch / fetchAll
body: <p>Not new to PHP, but only a day old to PDO. Surely I am doing something wrong here.</p>
  
  <pre><code>    $query = $conn-&gt;prepare("SELECT * FROM admins WHERE username = :username AND password = :password");
      $query-&gt;execute(array('username' =&gt; $username,'password' =&gt; sha1($password)));
      $result = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
      if (count($result) &gt; 0)
      {
          $_SESSION['user']['who']        = $result[0]['who'];
          $_SESSION['user']['email']  = $result[0]['email'];
          $_SESSION['user']['username']   = $result[0]['username'];
          echo REFRESH;
      }
      else
      {
          $message = "Invalid username / password.";  
      }
  </code></pre>
  
  <p>the only way I can declare those <code>$_SESSIONS</code> properly is if I use <code>$result[0]['fieldName'];</code> How can I just access it via <code>$result['fieldName'];</code> ?</p>