<table id="hor-minimalist-b" summary="Employee Pay Sheet"> <thead> <tr> <th scope="col">Cafe Id</th> <th scope="col">Mac Id</th> <th scope="col">Hits</th> <th scope="col">Date of Installation</th> <th scope="col">Status</th> </tr> </thead> <tbody> <?php while ($rows = mysql_fetch_array($result)) { $hits = $cafe_trac->getCafeHits($rows['cafe_id'], $rows['mac_id']); //checking whether the hits are null or not if ($hits) { $hits_count = $hits; } else { $hits_count = '0'; } $hits_trac = $cafe_trac->checkMac($rows['cafe_id'], $rows['mac_id']); //checking whether the cafe macs are working for three days or not if ($hits_trac == 1) { $img_url = '../images/ok.JPG'; } else { $img_url = '../images/notok.JPG'; } echo '<tr>'; echo '<td>' . $rows['cafe_id'] . '</td>';