title: PHP if statement in html-table outputs error
body: <p>I am new to HTML5 and PHP, I am trying to output a specific value in table data, If the database-retrieved-value is per condition.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;table class="scroll"&gt;
      &lt;thead style="background-color: #99E1D9; color: #705D56;"&gt;
          &lt;tr&gt;
              &lt;th&gt;ID&lt;/th&gt;
              &lt;th&gt;Name Client&lt;/th&gt;
              &lt;th&gt;Last Update&lt;/th&gt;
              &lt;th style="padding-left: 30%;"&gt;Status&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
          &lt;tbody id="hoverTable"&gt;
                   &lt;?php
  
                      $connection = mysql_connect('localhost', 'root', ''); 
  
                      mysql_select_db('patientdb');
  
                      $query = "SELECT id, name, date FROM clients";
  
                      $result = mysql_query($query);
  
                      //status waarden uit
                      $status = "SELECT status FROM clients";
                      $status_ = mysql_query($status);
  
                      while($row = mysql_fetch_array($result)){   //Loop through results
                      echo "&lt;tr&gt; 
  
                              &lt;td&gt;" . $row['id'] . "&lt;/td&gt; 
                              &lt;td&gt;" . $row['name'] . "&lt;/td&gt; 
                              &lt;td&gt;" . $row['date'] . "&lt;/td&gt;
                              &lt;td style='padding-left: 30%;'&gt;" . 
  
                                  if ($status_ &gt; 60){echo "red";
                                  } elseif ($status_ &gt; 50){echo "yellow";
                                  } else{echo "green";}
  
                                  . "&lt;/td&gt;
  
                           &lt;/tr&gt;"; 
                      }
                      mysql_close(); 
                  ?&gt;
  &lt;/tbody&gt;
  &lt;/table&gt; 
  </code></pre>
  
  <p>Error output</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected T_IF in
    /test/composition/login/portal/portal.php
    on line 204</p>
  </blockquote>
  
  <p>What is the right way to solve this?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>my current code:</p>
  
  <pre><code>&lt;table class="scroll"&gt;
      &lt;thead style="background-color: #99E1D9; color: #705D56;"&gt;
          &lt;tr&gt;
              &lt;th&gt;Naam Client&lt;/th&gt;
              &lt;th&gt;Laatste Update&lt;/th&gt;
              &lt;th style="margin-left: 40%; padding-left: 0%;"&gt;Status&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody id="hoverTable" style="font-size: 11pt;"&gt;
  
  &lt;?php
  
  
      $connection = mysql_connect('localhost', 'root', ''); 
       mysql_select_db('patientdb');
  
      $query = "SELECT id, naam, datum FROM clients";
      $result = mysql_query($query);
  
      $query2 = "SELECT status FROM clients";
      $result2 = mysql_query($query2);
  
      if (!empty ($result2)) {
      while ($row2 = mysql_fetch_assoc($result2)) {
      echo $row2['status'] . "&lt;br /&gt;";
      }
      }
  
      while($row = mysql_fetch_array($result)){   //Loop through results
      echo "&lt;tr&gt; 
  
              &lt;td&gt;" . $row['id'] . "&lt;/td&gt; 
              &lt;td&gt;" . $row['naam'] . "&lt;/td&gt; 
              &lt;td&gt;" . $row['datum'] . "&lt;/td&gt;
              &lt;td style='padding-left: 30%;'&gt;";
  
                  if ($results2 &gt; 60 &amp;&amp; $results2 &lt; 70) {
                      echo "red";
                  } elseif ($results2 &gt; 50 &amp;&amp; $results2 &lt; 60) { 
                      echo "yellow";
                  } else { 
                      echo "green";
                  }
  
                  echo "&lt;/td&gt;
  
           &lt;/tr&gt;"; 
      }
      mysql_close(); 
  ?&gt;
  
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Output the right data. but partly outside and partly inside the table.</p>