title: returning list of mysql_fetch_array while echo without repeating other text
body: <p>I'm trying to echo out a series of rows from MySQL database using mysql_fetch_array while loop into a table with form. I tried not to repeat the form-table and /table-/form tag but only repeat tr.../tr tag while echoing. </p>
  
  <p>Although, it is also repeating form-table and /table-/form tags.
  Can anybody please help. I just want tr.../tr to be repeated. 
  Below is the code:</p>
  
  <pre><code>$topmessage = '&lt;form&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="10"&gt;';
  
  $bottommessage = '&lt;/table&gt;&lt;div align="right"&gt;&lt;input type="submit" name="approveimage" value="Approve" /&gt;&lt;input type="submit" name="disapproveimage" value="Disapprove" /&gt;&lt;/div&gt;&lt;/form&gt;';
  
  $multirowing = '';
  
  require("../connect.php");
  $query2 = "SELECT * FROM imagegallery WHERE approve ='0'";
  $result2 = mysql_query($query2);
  while($rowphew = mysql_fetch_array($result2))
  {
      $multirowing .= '&lt;tr&gt;
         &lt;td&gt;' . $rowphew['username'] . '&lt;/td&gt;
         &lt;td&gt;
             &lt;a href="uploads/' . $rowphew['image'] . '"&gt;
                &lt;img src="uploads/' . $rowphew['image'] . '" width="100px" /&gt;
             &lt;/a&gt;
         &lt;/td&gt;
         &lt;td&gt;
             &lt;input type="checkbox" name="selectingimage" value="' . $rowphew['image'] . '" /&gt;
         &lt;/td&gt;
      &lt;/tr&gt;';
   }
  $message =  $topmessage . $multirowing . $bottommessage;
  echo $message;
  </code></pre>
  
  <p>The outcome result (as shown in source code) given is: (sorry cant upload image as need 10 reputation points..ahh)</p>
  
  <pre><code>&lt;form&gt;&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;Image1&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;BUTTONS&lt;/form&gt;
  
  &lt;form&gt;&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;Image1&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image2&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;BUTTONS&lt;/form&gt;
  
  &lt;form&gt;&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;Image1&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image2&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image3&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;BUTTONS&lt;/form&gt;
  
  &lt;form&gt;&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;Image1&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image2&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image3&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image4&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;BUTTONS&lt;/form&gt;
  
  &lt;form&gt;&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;Image1&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image2&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image3&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image4&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Image5&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;BUTTONS&lt;/form&gt;
  </code></pre>