Jump to content

counting number of instances


alohatofu

Recommended Posts

Ok, I have the following code. The problem with it is that everytime the "clli" is being dispalyed somewhere, it count as an instance.  I just want the total value of instances (actual count)

 

 

		<div id="vvisi"><?php
			$right_now = time();
			$start_date = $right_now - (86400*30);
			$clli = $objTask->clli;
			$query = "SELECT count(clli) FROM surv_item, surv_itemstatus "
			." WHERE surv_item.itemId = surv_itemstatus.itemId AND statusDate >= FROM_UNIXTIME($start_date)"
			." AND clli = '$clli'"
			."";

			$result = mysql_query($query);
			$row = mysql_fetch_array($result);

			if ( $row[0] >= 3 ) {
			?>
			<font color="red"><b><?php echo $GLOBALS['langForm']['chronicdetected'];?></font></b> -<?php  print $row[0]; ?></a>
			<?php
			}elseif ( $row[0] < 3 ) {
			?>
			<font color="green"><b><?php echo $GLOBALS['langForm']['nochronic'];?></font></b></a>
			<?php
			}
			else {
			}

		?></div>
        </div>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.