title: link syntax error using php
body: <p>I wrote a basic loop in php that worked for what I wanted, but now I am trying to add a link as well but cannot get the syntax right and the examples I have found the syntax does not work for me and keep getting errors. If anyone could show me where I am going wrong that would be amazing. Thank you in advance whether you are able to help or not!</p>
  
  <p>The code that is throwing errors is</p>
  
  <pre><code>&lt;a href=\"addcomment.php?id="'. $row['postid'] .'\"&gt;' "Add Comment" '&lt;/a&gt;");
  </code></pre>
  
  <p>and the full code is.</p>
  
  <pre><code>&lt;?php
      include("connect.php"); //connect to database
      //create query
      $get_messages_query = $db-&gt;prepare("
          SELECT * FROM `blogposts`
          ORDER BY `postid` DESC 
          LIMIT 5
          ");
      //Homepage should have last 5 blog posts this will take the //last 5 entered into the database and put them into an //array
  
      $get_messages_query-&gt;execute();
      //executes query above
  
      while($row = $get_messages_query-&gt;fetch())
      {
          $blog_post_history .=
          '&lt;div class="post" id="post"&gt;
              &lt;h1&gt;'. $row['title'] .' &lt;/h1&gt;
              &lt;h2&gt;' . $row['author'] . '&lt;/h2&gt;
              &lt;p&gt;'. $row['content'] . '&lt;/p&gt;
              &lt;a href=\"addcomment.php?id="'. $row['postid'] .'\"&gt;' "Add Comment" '&lt;/a&gt;");
  
          &lt;/div&gt;';
      }
  
      // while loop that takes info from db query and puts the //information in its own div with title andauthor having a //unique heading for css as well as a p for the content of //the blog. This loop puts the information in //$blog_post_history which is called upon in the div code 
      //below
  ?&gt;
  </code></pre>