【发布时间】:2017-11-03 05:32:29
【问题描述】:
我必须按位置、提供商或资产描述排序“详细报告” 问题是,虽然我得到了正确的结果,但我想显示类似的结果
位置 1:
此处的表格包含位于该位置的资产
位置 2:
具有位于此位置的资产的表...
与提供者和描述相同...
我的 PHP 和其他语言知识有限。所以,我想做一些类似的事情......
获取数组(整个数组不仅仅是一行),然后检查array[i] 中的位置是否等于array[i+1],然后打印带有行数据的<td>,否则结束该表,然后创建一个新的
地点:
最后是另一个包含与该位置匹配的行的表...
我如何在 PHP 中做到这一点?
例子:
This我目前拥有的
This 是我想做的事
这就是我在 PHP 中所做的事情
<?php
echo "<table>
<thead>
<tr>
<th></th>
<th>Ubicación</th>
<th>Código</th>
<th>Descripción</th>
<th>Costo Adquisición</th>
<th>Saldo a Depreciar de Activos</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>";
while($row = odbc_fetch_array($result)){
echo"<td></td>
<td><b>".$row["Ubicacion_actual"]."</b></td>
<td>".$row["Activo"]."</td>
<td>".$row["Descripcion"]."</td>
<td>".number_format($row["Costo_Adquisicion"],4)."</td>
<td>".number_format($row["Saldo_sin_depreciar"],4)."</td>
<td></td>
</tr>";
}
echo "</tbody>
</table>";
odbc_close($dbhandle);
?>
【问题讨论】:
标签: javascript php jquery html-table resultset