我Bootstrap DataTable
用来显示mysql记录。它有搜索按钮,当用户输入值时,表格只返回相应的值。
演示:http ://www.datatables.net/manual/styling/bootstrap-simple.html
现在可以添加特定列的所有数据。在上面的示例中,将有薪水列。现在我需要添加所有 57 人的薪水并将其显示为 Total 。而且,当表格更改时,值也必须同时更改。
请一些帮助:)谢谢
$result22=mysql_query("select * from cont_details");
if(mysql_num_rows($result22)>0)
{
while($row22=mysql_fetch_array($result22))
{?>
<tr <?php $line_qry = mysql_query("SELECT * FROM cont_sold WHERE cont_details_id= '".$row22['cont_details_id']."'");
if(mysql_num_rows($line_qry)>0)echo'style="color:green;"' ?>>
<td><?php echo $row22['cont_no']; $cont_details_id5 = $row22['cont_details_id']; ?></td>
<td>
<?PHP
$qry7 = mysql_query("SELECT * FROM depot_charges WHERE
`cont_details_id` = '$cont_details_id5' order by (str_to_date(`gate_in`,'%d-%m-%Y')) desc LIMIT 1");
$row7 = mysql_fetch_array($qry7);
$depot_details_id = $row7['depot_details_id'];
$qry8 = mysql_query("SELECT * FROM depot_details WHERE `depot_details_id` = '$depot_details_id'");
$row8 = mysql_fetch_array($qry8);
echo $depot_name = $row8['depot_name'];
?>
</td>
<td>
<?PHP $row8['depot_charge']; ?>
</td>
<td>
<?PHP $row8['depot_handling']; // ?>
</td>
<td>
<?PHP $row8['depot_repair']; ?>
</td>
<td>
<?PHP $row8['depot_place']; ?>
</td>
<td><?php $row8['cont_price']; ?></td>
<td>
<?php ?>
</td>
<td><?php echo $row8['cont_other']; ?></td>
<td>
<?PHP $row8['total']; ?>
</td>
</tr>
<?php
} ?>
在这里我需要添加 Total 列。