title: Inserting a closing tag in a database display
body: <p>I have a script that's styled to display a question followed by several answer choices, with the question and each answer wrapped in a div. However, I'd like the entire thing to be wrapped in an outer div (or section, actually), like this...</p>
  
  <pre><code>&lt;section class="OuterWrapper"&gt;
    &lt;div&gt;Question&lt;/div&gt;
    &lt;div&gt;Answer A&lt;/div&gt;
    &lt;div&gt;Answer B&lt;/div&gt;
    &lt;div&gt;Answer C&lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>I can easily insert the first part...</p>
  
  <pre><code>&lt;section class="OuterWrapper"&gt;
  </code></pre>
  
  <p>But I can't figure out where or how to insert the closing tag. Can anyone show me how to do it?  </p>
  
  <pre><code>$Q1 = null;
  while ($row = $stmt-&gt;fetch()) {
  $QID = $row['QID'];
  $URL = $row['URL'];
  $Value = $row['Value'];
  $Question = $row['Question'];
  $Answer = $row['Answer'];
  $Correct = $row['Correct'];
  $Correct = str_replace('1', 'correct', $Correct);
  $Correct = str_replace('2', 'wrong', $Correct);
  
  $Q2 = '  &lt;form action="" method="post" id="quiz"&gt;
  &lt;div style="margin-top: 10px;"&gt;'.$Question.'&lt;/div&gt;';
  
  if ($row["Question"] != $Q1) {
   $Q1 = $row["Question"];
   echo "{$Q2}\n";
  }
  
  echo '&lt;div class="Answer '.$Correct.'"&gt;&lt;input type="radio" name="'.$QID.'" id="quiz"   value="'.$Value.'" /&gt; '.$Answer.'&lt;/div&gt;' . "\n";
  }
  </code></pre>