我在一个网站上工作。这是我当前代码的一部分:
$num_cat_rec = mysqli_query($mysqli, "SELECT * FROM tb_revisiones_tor GROUP BY tipo_tor")
or die (mysqli_error($dbh));
//display the results
while ($row_tor = mysqli_fetch_array($num_cat_rec))
{
$puntos_tor_conseguidos =0;
?>
<div class="col-lg-4 col-xs-4">
<!-- small box -->
<div class="small-box bg-purple">
<div class="inner">
<?php
$usuario_tor = $row_tor['evaluado'] ;
$tipo_tor = $row_tor['tipo_tor'];
$puntos_tor_conseguidos = $puntos_tor_conseguidos+get_puntos_tor_conseguidos($usuario_tor,$tipo_tor);
?>
<h3><?php echo $puntos_tor_conseguidos?></h3>
<H4><?php echo $row_tor['nombre']?></h4>
</div>
<div class="icon">
<i class="ion ion-ribbon-a"></i>
</div>
<a href="otros_rubros_reporte.php" class="small-box-footer">
<?php echo $lang['MORE_INFO']?> <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<?php
}这是当前的输出:

这是数据库结构和一些数据。

正如您可能看到的那样,我将数据组按字段nombre显示,如图片中所示为蓝色矩形。
我所需要的是显示每个组的字段值之和为大数,但只对某些用户(字段)显示。
所选用户的条件必须是:
get_unit($row_tor['evaluado']= $_POST['un'];get_unit(x)是PHP中的一个函数。
我该怎么做?
发布于 2017-11-05 06:09:32
https://stackoverflow.com/questions/47118404
复制相似问题