title: highlight a box in a list according to a condition in another table
body: <p>I have two tables :</p>
  <p>Table 1 (overall Score )
  <a href="https://i.stack.imgur.com/5DlUy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5DlUy.png" alt="overall" /></a></p>
  <p>Table 2 (weekly score )
  <a href="https://i.stack.imgur.com/5DXWe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5DXWe.png" alt="weekly" /></a></p>
  <p>I have a leaderboard where I am echoing the overall score value <strong>from Table 1</strong> :</p>
  <p><a href="https://i.stack.imgur.com/9cItU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9cItU.png" alt="lb" /></a></p>
  <p><strong>Problem :</strong> What I am trying to do here is that whoever scores &quot;-10&quot; in table 2 (weekly score) , I want to alert the user by highlighting the color of their box in the leaderboard ,which is yellow now, to red.</p>
  <p>current css involved :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>li mark div {
      display: block;
      margin: 4px;
      padding: 5px;
      min-height: 50px;
      border: 2px solid #eebb55;
      border-radius: 7pt;
      background: grey;
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Php involved to display the list.This is for &quot;overall&quot; (right tab in leader board) .Similar exist for weekly too .</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="overalllb" class="leadboardcontent" style="display:none"&gt;
      &lt;div class="leaderboard"&gt;
          &lt;ol&gt;
              &lt;li&gt;
                  &lt;mark&gt;
                      &lt;?php  while( $toprow2 = sqlsrv_fetch_array( $stmt3) ) {
                          echo  "&lt;div class='parent-div'&gt;&lt;span class='rank'&gt;" . $toprow2['overallRank'] . "&lt;/span&gt;&lt;span class='name'&gt;" . $toprow2['EmployeeName'] . "&lt;/span&gt;&lt;span class='points'&gt;" . $toprow2['Total_points_Rewarded'] . "&lt;/span&gt;&lt;/div&gt;";
                      } ?&gt;
                  &lt;/mark&gt;
              &lt;/li&gt;
          &lt;/ol&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Queries passed to retrieve info from both the tables :</p>
  <p><strong>1.query 1</strong> - to find out all the employees with a score of -10.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$q200 = " select *
    from Table2
    where  WeekNumber = 'week1' and pointsRewarded = '-10';";
    $stmt200=sqlsrv_query($conn,$q200);
    if($stmt200==false)
    {
    echo 'error to retrieve info !! &lt;br/&gt;';
    die(print_r(sqlsrv_errors(),TRUE));
    }</code></pre>
  </div>
  </div>
  </p>
  <p><strong>query 2- to retrieve from table 1 all the employees :</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$q20 = "select *
    from EmployeeTable
    order by Total_points_Rewarded desc";
    $stmt20=sqlsrv_query($conn,$q20);
    if($stmt20==false)
    {
    echo 'error to retrieve info !! &lt;br/&gt;';
    die(print_r(sqlsrv_errors(),TRUE));
    }</code></pre>
  </div>
  </div>
  </p>
  <p>I am using PHP,Please suggest me a way to do it.God bless.</p>