If else inside my echo inside <tr><td>
<p>How can I add if-else statement inside my echo tr and td?
I try this code below but my output is a blank page.</p>

<pre><code>&lt;?php
$stmt = $dbh-&gt;prepare("$query");
$stmt-&gt;execute();
$result = $stmt-&gt;fetchAll();
$i="0";
$ext = EXT;
if ($stmt-&gt;rowCount() &gt; 0) {
    foreach($result as $value) {
        $i++;   
        $id = $value['id'];
        $gccode = $value['gccode'];
        $datecreated = $value['datecreated'];
        $notes= $value['notes'];
        $branch = $value['branch'];
        $groupid = $value['groupid'];
        $status = $value['status'];
        echo "&lt;tr  class=\"gradeA\"&gt;
        &lt;td&gt;$i&lt;/td&gt;
        &lt;td&gt;$id&lt;/td&gt;
        &lt;td&gt;$gccode&lt;/td&gt;
        &lt;td&gt;$datecreated&lt;/td&gt;
        &lt;td&gt;$notes&lt;/td&gt;
        &lt;td&gt;$branch&lt;/td&gt;
        &lt;td&gt;" if ($value['groupid']=="1"){ echo  'Regular';}
        else { echo  'Complimentary'; } "&lt;/td&gt;
        &lt;td&gt;$status&lt;/td&gt;
        &lt;/tr&gt;";
    }
}
</code></pre>