title: PHP show function results after calling the function
body: <p>I am calling a PHP Function here:</p>
  
  <pre><code>&lt;div class="box"&gt;&lt;h2&gt;Average Hold Time&lt;/h2&gt;&lt;?php echo AverageHoldTime($queue_name, $date); ?&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Here is the actual function:</p>
  
  <pre><code>if(!function_exists("AverageHoldTime")) {
      function AverageHoldTime($queuename, $date) {
          global $pbx01_pdoconn;
  
          $stmt = $pbx01_pdoconn-&gt;prepare("SELECT avg(arg1) as avg_hold_time FROM ast_queue_log 
          WHERE queuename = :queuename 
          AND DATE(time) = :date 
          AND event = :event 
          ORDER BY time DESC ");
          $stmt-&gt;execute(array(':queuename' =&gt; $queuename, 
          ':date' =&gt; $date, 
          ':event' =&gt; 'CONNECT'));
          $result = $stmt-&gt;fetch();
          return gmdate("H:i:s", $result["avg_hold_time"]);
      }
  }
  </code></pre>
  
  <p>but i want to be able to change the <code>.box</code> div to have a background colour if the returned result is  greater than X</p>
  
  <p>UPDATE</p>
  
  <p>How can i check if the result of the function is greater than X which is a value stored in a database.</p>
  
  <p>I have a table called <code>alarms</code> which has the function names and then the values which the function returned results cannot go over otherwise it'll show the div background a different colour</p>
  
  <p>how can i make it so my functions check if the returned result goes over the value in the alarms table</p>