【发布时间】:2017-11-02 12:08:22
【问题描述】:
作为 PHP/MySQL 的新手。
我在过去三周内使用 PHP/MySql,它融合在一起很棒,但这是从 Mysql 数据到 php 的大量学习。
我正在尝试将数据 Id 作为表获取到 Header 中的问题,但不知何故它不起作用,并且根本不显示或出错。
就像所有的“交易类型”进入标题或 TR,然后“每个组金额”进入表格正文或 TD
这是代码
<table class="table table-condensed table-bordered table-striped table-hover dt-responsove wrap" cellspacing="0" >
<thead>
<th Class="table-header-total">
<?php
while (($grouptotalrow = mysqli_fetch_array($grouptotalorder1, MYSQLI_BOTH)) != NULL) {
?>
<td class="table-smaller-text-bolder"><?php echo $grouptotalrow["transaction_type"];?></th>
<?php
}
mysqli_free_result($grouptotalorder1);
?>
<?php
while (($grouptotalrow = mysqli_fetch_array($grouptotalorder, MYSQLI_BOTH)) != NULL) {
?>
<td class="table-smaller-text-bolder"><?php echo $grouptotalrow["Each_group_Amount"];?></td>
<?php
}
mysqli_free_result($grouptotalorder);
?>
</tr>
</thead>
<tbody>
</tbody>
</table>
这是一个数据库
SELECT
settlement_id,
total_amount,
transaction_type,
amount_description,
SUM(amount) AS `Each_group_Amount`
FROM
settlements
WHERE
transaction_type = 'order'
OR transaction_type = 'Refund'
OR transaction_type = 'ServiceFee'
OR transaction_type = 'other-transaction'
OR transaction_type = ''
GROUP BY settlement_id ASC , amount_description ASC
这个结果不是我要找的
【问题讨论】:
-
表头标签是
-
完成将 td 更改为 th (这是我的错误,我忽略了它)但遗憾的是这个问题仍然与我重写时相同。
-
什么问题?