如何在php中找到星形符号的平均值和显示平均值

时间:2015-10-19 10:07:49

标签: php

数据

RATE_FEED_ID, RATE_FEED_VALUE, RATE_FEED_STATUS, DATE      RATE_FEED_TYPE  
 1                   3                Active       -              1  
 1.                 5                 Active       -              1   
 2.                 1                 Active       -              1  
 3.                 2                 Active       -              1     
 4.                 3                  "           -              1  

我想要RATE_FEED_VALUE的平均值,我希望以星号格式显示平均值

<?php
//RATING AVERAGE COUNT
$star="SELECT  SUM(RATE_FEED_VALUE) from FEEDBACK_RATING WHERE (RATE_FEED_TYPE='1') AND EMPLOYEE_ID='".$row["EMPLOYEE_ID"]."'";
$query = mysql_query($star); 
while($data = mysql_fetch_array($query)){                  
    $r= $data['RATE_FEED_VALUE'];
}

?>

0 个答案:

没有答案