PHP/CSS Highlight the details for the currently logged in user
<p>The code creates a table in which the currently logged in user details are highlighted in blue. This is done using a <code>$_SESSION['email']</code> to identify the currently logged in user. </p>

<p>Within the table construction the  elements are declared as a css class <code>curUser</code>. This <code>.curUser</code> is used in the CSS  file to identify and colour/ highlight the current logged in user. </p>

<p>The problem is that a blank line/row is created after the current user has been selected. I am fairly sure that the problem is the php table creation code. </p>

<p>Can someone please have a look at this and point out the problem, as it is eluding me at present?</p>

<p><strong>HTML:</strong></p>

<p>

    </p>

<pre><code>&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Selections&lt;/h1&gt;
    &lt;?php
    require 'configuration.php';
    require 'connectTodb.php';
    ?&gt;


    &lt;table  border="1" id="parent" &gt;
        &lt;tr&gt;
            &lt;th&gt;#&lt;/th&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;?php
            for ($i = 1; $i &lt; 6; $i++) {
                print("&lt;th&gt;Week " . $i . "&lt;/th&gt;");
            }
            ?&gt;
        &lt;/tr&gt;

        &lt;?php
        $sql = "SELECT selections.week,selections.team,users.email,users.name,selections.outcome FROM users,selections WHERE users.email = selections.email ORDER BY name,week";
        $result = mysqli_query($connection, $sql);
        print mysql_error();
        if (!$result) {
            die('Could not query:' . mysql_error());
        }
        $rowId = 0;
        $rows = mysqli_fetch_assoc($result);

        while ($rows != null) {
            print("&lt;tr&gt;");
            $rowId++;
            $name = $rows["name"];
            if ($rows['email'] == $_SESSION['email']) {
                print("&lt;td class=" . $curUser . " type='hidden'   value=" . $rows['email'] . "&gt;" . $rowId . "&lt;/td&gt;");
                print("&lt;td class=" . $curUser . "&gt; " . $rows["name"] . "&lt;/td&gt;");
                while ($rows != null &amp; $name == $rows['name']) {
                    print("&lt;td class=" . $curUser . "&gt; " . $rows["team"] . "&lt;/td&gt;");
                    $rows = mysqli_fetch_assoc($result);
                }
                print("&lt;/tr&gt;");
            } else {
                print("&lt;td type='hidden'  value=" . $rows['email'] . "&gt;" . $rowId . "&lt;/td&gt;");
            }
            print("&lt;td&gt; " . $rows["name"] . "&lt;/td&gt;");
            while ($rows != null &amp; $name == $rows['name']) {
                print("&lt;td &gt; " . $rows["team"] . "&lt;/td&gt;");
                $rows = mysqli_fetch_assoc($result);
            }
            print("&lt;/tr&gt;");
        }
        ?&gt;
    &lt;/table&gt;

        &lt;?php
        mysqli_close($connection);
        ?&gt;

&lt;/body&gt;
</code></pre>

<p></p>

<p><strong>CSS</strong> </p>

<pre><code>.curUser, #rowId  {
  background-color: lightblue; 
}
</code></pre>