title: Using UNIX_TIMESTAMP to determine colour of row
body: <p>I currently have this code:</p>
  
  <pre><code>        $rawsql2 = "SELECT 
      *
      FROM 
          _erc_foffices n 
      INNER JOIN 
          _erc_openings o ON n.id = o.branch_id 
      INNER JOIN 
          _erc_openings_times t ON o.id = t.opening_id
      WHERE 
      (
          n.id = %d
      );";
  
      $sql2 = sprintf($rawsql2, mysql_real_escape_string($id));
  
      $result2 = mysql_query($sql2);
  
      /*These if &amp; while statements decide whether or not the information should be displayed. If no results are returned from the query above then an alternative message is shown.*/
      if(mysql_num_rows($result2) &gt; 0) {
      $count=0;
      $day = 1;
      echo "&lt;div class='timetable'&gt;&lt;p&gt;";
          while ($row = mysql_fetch_array($result2, MYSQL_ASSOC)) {
              if ($day=='1') { echo "&lt;b&gt;Sun - &lt;/b&gt;";} else if ($day=='3') { echo "&lt;b&gt;Mon - &lt;/b&gt;"; } else if ($day=='5') { echo "&lt;b&gt;Tue - &lt;/b&gt;"; } else if ($day=='7') { echo "&lt;b&gt;Wed - &lt;/b&gt;"; } else if ($day=='9') { echo "&lt;b&gt;Thu - &lt;/b&gt;"; } else if ($day=='11') { echo "&lt;b&gt;Fri - &lt;/b&gt;"; } else if ($day=='13') { echo "&lt;b&gt;Sat - &lt;/b&gt;"; } else { echo "";}
              if ($row["open"] == 0 &amp;&amp; $row["close"] == 0) {
       if ($day % 2 == 1) {
           echo "closed";
       }
  
  }
              else{
              echo "" . substr($row["open"], 0, -3) . "-" . substr($row["close"], 0, -3) . " &amp;nbsp;&amp;nbsp; ";
              if ($count % 2 !=0 ){ echo  "&lt;br/&gt;"; } }
  $count++;
  $day++;
  
          }
      } else {
              echo "Error";
      }
  </code></pre>
  
  <p>which pulls a timetable from the database, and then display it in the format:</p>
  
  <p>Sun - 08:00-12:30    13:30-16:30<br>
  Mon - 09:00-17:00    18:00-20:00  etc</p>
  
  <p>What I want to do now, is if for example, the current say is Sunday, then the Sunday row font would be red. Is this possible?</p>
  
  <p>Thanks for any help</p>