title: php read variables from sql result
body: <p>I'm working with some dynamic strings in php.
  This should create a string like:</p>
  
  <blockquote>
    <p>Hey Deben Oldert</p>
  </blockquote>
  
  <p>Where Deben and Oldert are both variables.</p>
  
  <pre><code>$firstname = "Deben";
  $lastname = "Oldert";
  
  $body = mysqli_fetch_assoc(mysqli_query($conn, "SELECT body FROM mail WHERE type='{$_GET['type']}'"))['body'].PHP_EOL;
  
  //The body field contains &lt;p&gt;Hey $firstname $lastname&lt;/p&gt;
  
  echo $body
  </code></pre>
  
  <p>It outputs <code>Hey $firstname $lastname</code><br>
  When I tried</p>
  
  <pre><code>$a = 'Deben';
  $b = 'Oldert';
  $b = "Hey $a $b".PHP_EOL;
  echo $b;
  </code></pre>
  
  <p>It outputs <code>Hey Deben Oldert</code></p>
  
  <p>So why isn't it working from a mysqli_fetch result?</p>