title: PHP Array to string conversion $_SESSION
body: <p>Hey guys so I've come across what seems to be a strange issue when trying to output some SQLi data when retrieving it and assigning it to a $_SESSION. I'm quite new to PHP so the chances are I'll be doing something stupid..</p>
  
  <p>So here is my login.php PHP section: </p>
  
  <pre><code>&lt;?php
  require 'connections.php';
  if(isset($_POST['Login'])){
  
      $EM = $_POST['Email'];
      $PW = $_POST['Password'];
  
      $result = $con-&gt;query("SELECT * FROM users where Email='$EM'");
  
      $row = $result-&gt;fetch_array(MYSQLI_BOTH);
  
      if(password_verify($PW, $row['Password'])){
  
  
      session_start();
  
      $_SESSION["UserID"] = $row['UserID'];
      $_SESSION["FirstName"] = $row=['Firstname'];
  
      header('Location: account.php');
      }
      else{
          session_start();
          $_SESSION['LogInFail'] = "Yes";
      }
  
  }
  ?&gt;
  </code></pre>
  
  <p>So above I believe I set my <code>$_SESSION["FirstName"]</code> to the users Firstname which is being selected from the database.</p>
  
  <p>Then here is part of my account.php PHP code:</p>
  
  <pre><code>&lt;?php
   require 'connections.php';
   session_start();
   if(isset($_SESSION['UserID'])){
   }
   else {
      header('Location: login.php');
   }
   ?&gt;
  </code></pre>
  
  <p>Then here is the problem:</p>
  
  <pre><code>&lt;b&gt;Welcome to your account &lt;?php echo $_SESSION['FirstName']; ?&gt;!&lt;/b&gt;
  </code></pre>
  
  <p>It is returning this error:</p>
  
  <blockquote>
    <p>Welcome to your account 
    <br>Notice: Array to string conversion in C:\Users*\Desktop\XAMMP\htdocs\PHP\Website\account.php on line 36
    <br>Array!</p>
  </blockquote>
  
  <p>Thanks for reading and if you need any more information let me know!</p>