例如,在while循環,結果將通過車輛數這樣如何從同一個PHP While While循環中打斷輸出?
Vehicle num total_amount
TEST V 1234 500
TEST V 1234 500
TEST V 1234 500
TEST w 785 1000
TEST w 785 1000
TEST Z 589 700
TEST Z 589 700
TEST Z 589 700
But i want to like this.
Vehicle num total_amount
TEST V 1234 500
TEST V 1234 500
TEST V 1234 500
Vehicle No: TEST V 1234
Total amount: 1500
TEST w 785 1000
TEST w 785 1000
Vehicle No: TEST w 785
Total amount: 2000
TEST Z 589 700
TEST Z 589 700
TEST Z 589 700
Vehicle No: TEST Z 589
Total amount: 2100
我想顯示順序顯示喜歡使用PHP + MYSQL 如何解決這個問題DIS,任何人可以告訴?
這裏我的代碼示例?
<table class="table table-table-striped accord-content even" width="100%" style="clear:both;" id="textttt">
<thead>
<tr class="bg-green" style="background:#DBB74E!important; color:#698602 !important" >
<th>S No</th>
<th>Owner Name</th>
<th>Truck Number</th>
<th>total</th>
</tr>
</thead>
<?php
$query_all = mysql_query("select * from testing where ownername='" . $_POST['ownername'] . "' and dc_date between '".$weekenddate."' and '" . $_POST['datewe'] . "' and status='Verified' order by truckk_number ASC");
while ($fet_all = mysql_fetch_array($query_all)) { ?>
<tr class="accord-content even bg-gray" style="color:#698602 !important;">
<td><?php echo $fet_all['id']; ?></td>
<td><?php echo $fet_all['ownername']; ?></td>
<td><?php echo $fet_all['truckk_number']; ?></td>
<td><?php echo $fet_all['total']; ?></td>
</tr>
<?php } ?>
</table>
我想顯示明智的車輛總數和車輛數量。
你直到現在都試過了嗎?把你的代碼放在這裏? –
一般條款,跟蹤當前的總和,和當前的車輛號碼。當車輛號碼變化時,吐出舊車號碼和總和,然後重置 –